|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: Monday, October 22, 2012 7:08 AM
Points: 232,
Visits: 112
|
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 3:25 AM
Points: 1,371,
Visits: 2,302
|
|
| I got an error when I tried in SQL Server 2005...!!!
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, May 02, 2013 1:50 AM
Points: 167,
Visits: 37
|
|
That query gives perfect result.
Thanks. Mandar Kavishwar. EC Infosolution
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: Saturday, April 16, 2011 10:29 AM
Points: 502,
Visits: 399
|
|
Seems to be a lot missing assumptions. Each given answer can be correct given different starting conditions.
Running the code as-is got me an error first (tblUsers does not exist. doh!).
I then created the table and got 0 rows as the result.
I added 1 row and got 1 row as the result.
Added another row and got 2 rows as the result.
Adding more rows kept the result at 2 rows.
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Today @ 2:05 AM
Points: 1,103,
Visits: 1,200
|
|
WTF is tblUsers? It can be a table or a view or nothing.
If it is anything defined (table or view) it can be empty (0 rows returned), it can contain just 1 row (1 row returned) or it can contain more rows (2 rows returned). With these assumptions - three answers possible - tblUsers is undefined and the script returns an error message. QED
See, understand, learn, try, use efficient © Dr.Plch
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 2:53 AM
Points: 1,530,
Visits: 359
|
|
| i fail to understand what is the learning in this question. anybody plz. suggest...
|
|
|
|
|
SSCommitted
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 2:53 AM
Points: 1,530,
Visits: 359
|
|
if the query contains a top 3
SELECT top 3 c.*, Users.* FROM reptec_changedim c, Users
then this will return 3 records...
|
|
|
|
|
SSChasing Mays
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 7:01 AM
Points: 658,
Visits: 149
|
|
| I get an error saying tblUsers doesn't exist.. Is this a Version issue or missing information? im on SQL 2005
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 7:31 AM
Points: 1,164,
Visits: 2,601
|
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Tuesday, May 21, 2013 7:31 AM
Points: 1,164,
Visits: 2,601
|
|
|
|
|