From: AussieRules on 12 May 2010 08:27 Hi, I am trying to select all the records from a table where a field has a certain value or is null. I tried :
From: Gert-Jan Strik on 13 May 2010 08:25 Try this: SELECT my_column FROM my_table WHERE ( my_column = @certain_value OR my_column IS NULL ) -- Gert-Jan AussieRules wrote: > > Hi, > > I am trying to select all the records from a table where a field has a > certain value or is null. > > I tried :
From: --CELKO-- on 13 May 2010 10:36 >> I am trying to select all the records [sic: rows are not records] from a table where a field [sic: columns are not fields] has a certain value or is NULL. << SELECT FROM Foobar WHERE vague_column = @in_search_value OR vague_column IS NULL; Why does this have the feel of homework in an intro SQL class? Google up the new IS DISTINCT FROM comparison operator in Standard SQL and impress your teacher with the reserch other people do for you.
|
Pages: 1 Prev: SQL Agent CmdExec step and environment variables Next: REPOST: basic question re select |