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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SELECT ANY

Author  Topic 

Stanley Tan
Starting Member

25 Posts

Posted - 2002-08-08 : 08:24:11
Is there a character used to specify ANY?

For example, this should return all rows as if there were no WHERE clause:

SELECT * FROM MyTable WHERE MyColumn = @MyColumn

Page47
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2002-08-08 : 08:27:58
eh?

If you want all rows why would you have a WHERE clause?

Maybe you are thinking about something like, "If MyColumn is NULL I want back all the rows. If it's not NULL I want only the matches on MyColumn"


select <col_list>
from MyTable
where MyColumn = isnull(@MyColumn, MyColumn)

 


Jay White
{0}
Go to Top of Page
   

- Advertisement -