Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

Are we in all these cities? Expand / Collapse
Author
Message
Posted Monday, July 12, 2010 9:03 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Yesterday @ 6:16 AM
Points: 2,006, Visits: 2,004
Comments posted to this topic are about the item Are we in all these cities?
Post #951136
Posted Monday, July 12, 2010 10:04 PM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Thursday, July 10, 2014 12:49 PM
Points: 1,676, Visits: 1,754
IMHO, this question does not really illustrate "the point that a subquery cannot be terminated with a semicolon". Semicolons terminate the statements and since the subquery is not the whole statement, it is rather obvious that it cannot be terminated. This question rather falls into a nasty category of those questions where the readers are suggested to use, as Hugo once aptly put it, "psychic powers" to figure out whether the author of the question meant to introduce a simple syntax error or such error is simply a result of an oversight.

Oleg
Post #951143
Posted Monday, July 12, 2010 10:15 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, July 21, 2014 3:43 AM
Points: 1,938, Visits: 1,162
I got wrong.Because i did not observe the semicolon.

Malleswarareddy
I.T.Analyst
MCITP(70-451)
Post #951145
Posted Tuesday, July 13, 2010 1:33 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Yesterday @ 3:22 PM
Points: 5,925, Visits: 8,174
I got it wrong too. I was looking at the logic of the query and the subquery, not at all the fine punctuation details.

Learned nothing from this question. This is the kind of error (typo) that people make now and then - and then the error message will quickly help you figure out what's wrong.

I don't mind questions about errors commonly made in T-SQL, or about errors that are hard to figure out due to how the parser presents the error. But I have never seen anyone use a semicolon in a subquery. And if someone does use it, the error message is clear: "Incorrect syntax near ';'." - and if you double-click the error message, you are taken to the line with the offending semicolon.

I hope the author will stop by and tell us what he/she was trying to teach us with this question. Maybe I missed the deeper issue here.



Hugo Kornelis, SQL Server MVP
Visit my SQL Server blog: http://sqlblog.com/blogs/hugo_kornelis
Post #951195
Posted Tuesday, July 13, 2010 2:05 AM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 7:50 AM
Points: 3,859, Visits: 5,001
Interesting question - illustrates the point: read everything carefully before doing, otherwise rework might be the order of the day.

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Post #951210
Posted Tuesday, July 13, 2010 2:10 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, July 4, 2014 9:03 AM
Points: 1,415, Visits: 796
Sorry, but I think this only checks if you've read the question properly.

I think everbody KNOWS you don't put a semi colon in the middle of a query (no matter how many people get the question wrong).
Post #951211
Posted Tuesday, July 13, 2010 3:26 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 2:56 AM
Points: 13,298, Visits: 10,163
I got it wrong because I overlooked the semicolon.
I was focusing more on the use of subqueries with count in a query, which I thought was the point of this question.




How to post forum questions.
Need an answer? No, you need a question.
What’s the deal with Excel & SSIS?

Member of LinkedIn. My blog at LessThanDot.

MCSA SQL Server 2012 - MCSE Business Intelligence
Post #951236
Posted Tuesday, July 13, 2010 3:34 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, July 16, 2014 6:22 AM
Points: 271, Visits: 96
Interesting!! victim was ;..........
Post #951244
Posted Tuesday, July 13, 2010 3:49 AM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Thursday, April 21, 2011 5:47 AM
Points: 733, Visits: 64
Lousy question, if you ask me ....

It encourages us to copy and paste the question into the query editor in order to avoid little misreadings. I don't think this is the appropriate way to answer questions which are supposed to teach us something.

I don't have AdventureWorks installed on any instance, so, after concluding that it should be "return all records" I tried a similar query on our own contacts table, typing the statement manually and (of course!) not making such a mistake!




If you can't do things the way they must be done, do them the way you can ...
Post #951254
Posted Tuesday, July 13, 2010 4:26 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Sunday, July 13, 2014 8:35 AM
Points: 3,926, Visits: 1,087
Well, got it wrong to. Not that it matters, but this is more a "proofreading" question than anything else. I haven't submitted any QOD myself, so i shouldn't complain...
But did it anyway


Lars Broberg
Elbe-Data AB
Post #951276
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse