TalkPHP

TalkPHP (http://www.talkphp.com/forums.php)
-   Absolute Beginners (http://www.talkphp.com/absolute-beginners/)
-   -   sql statement help (http://www.talkphp.com/absolute-beginners/2955-sql-statement-help.html)

sarmenhb 06-12-2008 10:33 PM

sql statement help
 
if i wanted to select all columns and to display only the rows that dont contain any data in a specific column how do i do that?

i tried this statement and it doesnt work

Code:


select * from tbl_clone where grp = 'NULL' order by priority


delayedinsanity 06-12-2008 10:54 PM

Code:

SELECT * FROM tbl_clone WHERE grp IS null ORDER BY priority
-m

Wildhoney 06-13-2008 12:26 AM

ISNULL() is also a function.

dschreck 06-13-2008 05:00 AM

Quote:

Originally Posted by Wildhoney (Post 15596)
ISNULL() is also a function.

As a side note, avoid using ISNULL() ON clause of a join (ie: JOIN ... ON(ISNULL()))

But yes, ISNULL() is a valid control flow function :D


All times are GMT. The time now is 09:14 AM.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0