Marcus Bointon wrote:
I have a table that contains a foreign key that can be null. When I do
a search I want to have the matches that are null appear first, and
then all other values sorted by another column. My data looks like this:
idname
nullabc
1def
2xyz
nullzzz
7
I have a table that contains a foreign key that can be null. When I
do a search I want to have the matches that are null appear first,
and then all other values sorted by another column. My data looks
like this:
id name
nullabc
1 def
2 xyz
nullzzz
7 aaa
I wan
On Thursday 06 February 2003 17:05, Octavian Rasnita wrote:
> Please tell me how can I sort a column and force placing the null values to
> the end of list?
Something like:
SELECT ... ORDER BY IF(column_name IS NULL, 1, 0), column_name;
--
For technical support contracts, goto https://order.m
s.html
* http://www.mysql.com/doc/en/CREATE_TABLE.html
* http://www.mysql.com/doc/en/Working_with_NULL.html
* http://www.mysql.com/doc/en/Comparison_Operators.html
This was an automated response to your email 'Sorting with null values'.
Final search keyword used to quer
Hi all,
Please tell me how can I sort a column and force placing the null values to
the end of list?
Thank you sql query
Teddy,
Teddy's Center: http://teddy.fcc.ro/
Email: [EMAIL PROTECTED]
-
Before posting, please check: