Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-04-01 : 09:18:37
|
| Todd writes "I wish to recieve only one result from he database out of all that i have in the database.heres my SQL statement: strSQL = "SELECT tblUsers.url FROM tblUsers WHERE tblUsers.Pops >= 5 AND tblUsers.ID <>= '" + strID + "' AND rowcount <= 1 ORDER BY tblUsers.Pops DESC"This doesn't work, i want it to only give me one result that matches my criteria, the one with the highest number of shows and above 5.Please HelpYours Sincerely Todd Bryant" |
|
|
setbasedisthetruepath
Used SQL Salesman
992 Posts |
Posted - 2002-04-01 : 09:32:40
|
Check out the TOP clause of a select statement in BOL.quote: Todd writes "I wish to recieve only one result from he database out of all that i have in the database.heres my SQL statement: strSQL = "SELECT tblUsers.url FROM tblUsers WHERE tblUsers.Pops >= 5 AND tblUsers.ID <>= '" + strID + "' AND rowcount <= 1 ORDER BY tblUsers.Pops DESC"This doesn't work, i want it to only give me one result that matches my criteria, the one with the highest number of shows and above 5.Please HelpYours Sincerely Todd Bryant"
setBasedIsTheTruepath<O> |
 |
|
|
|
|
|