Last post Jul 08, 2013 11:34 PM by joeb1415
Jan 07, 2007 06:36 PM|hypercode|LINK
You can select all fields with:
SELECT * FROM [TableName]
How do you select NOTHING or NONE with a SELECT statement?
Jan 07, 2007 07:08 PM|vcsjones|LINK
Jan 07, 2007 07:09 PM|Scott Mitchell|LINK
I'm a little confused. If you don't want to select anything, then why run the SQL statement at all?
But, to answer your question, you can run a statement that returns no records by adding a WHERE clause that always evaluates to false, like:
SELECT * FROM [TableName] WHERE 1 = 0
Jan 09, 2007 08:07 AM|hypercode|LINK
Thanks Scott, that straightens me out.
The reason for NOTHING is just that I want to override the default of SELECT * FROM [TableName].
I don't remember the exact reason why right now, I have to go back and look at that page.
Jul 08, 2013 11:34 PM|joeb1415|LINK
SELECT TOP 0 0
Returns a table with no rows and 1 column with no name.
You can name the column if you want:
SELECT TOP 0 0 COL_NAME