Results 1 to 2 of 2
Thread: Distinct problem
Sep 13, 2012, 04:08 #1
- Join Date
- Jan 2005
- 0 Post(s)
- 0 Thread(s)
$qry="SELECT DISTINCT(city) FROM table WHERE country='$country'";
If there are no rows with a 'city' where country=$country, it still gives 1 row result of NULL!
Why does it return a blank row rather than no rows?
Sep 13, 2012, 04:52 #2
DISTINCT is not a function, don't put () around the column name.
If you get a row with value NULL returned, then apparently there is a row in the database where country=$country and city=NULL.Guido - Community Team Leader
The Votes Are In: The Winners of the 2013 Community Awards are...
Blog - Free Flash Slideshow Widget