Thanks for the posts guys. I actually did something similar to the zz thing earlier but I'm trying to get vincent's thing to work because it's cool.
Here's my statement:
select fname, lname, CASE WHEN fname ="" THEN 1 ELSE 0 END as fnameempty, CASE WHEN lname ="" THEN 1 ELSE 0 END as lnameempty FROM address WHERE uname='mark' ORDER BY fnameempty, lnameempty, lname, fname, email;
and here's the error:
ERROR 1064: You have an error in your SQL syntax near 'WHEN fname ="" THEN 1 ELS
E 0 END as fnameempty, CASE WHEN lname ="" THEN 1 ELSE ' at line 1
after I fix this bug, I'd actually like to select all the fields but it seems strange to add something after the select :
select , CASE WHEN...
but I'm not getting and error message with that.
Thank you all for the help so far.
Mark