C
|
copper21 4/22/2015 |
hernaccs, |
H
|
hernanccs author 4/22/2015 |
hernaccs, You can try CASE statement. Insert this into your SELECT statement: CASE WHEN picture is NULL OR picture = '' THEN 2 ELSE 1 END AS PictureOrder Your SELECT Statement/Query should look like this: SELECT id, name, picture, CASE WHEN picture is NULL OR picture = '' THEN 2 ELSE 1 END AS PictureOrder FROM YOUR_TABLE WHERE....(if you have WHERE statement) ORDER BY PictureOrder, name Brian
|
H
|
hernanccs author 4/22/2015 |
Hello Brian, thanks for your reply i tried your suggestion and i get an error when i try to run the query, i also tried remove the second condition on the WHEN CASE CASE WHEN picture is NULL THEN 2 ELSE 1 END AS PictureOrder and still get the error. my exact query is this SELECT ID, name, picture FROM staff ORDER BY picture, name thanks
|