In an SQL statement, if the field to be sorted is empty, how can this problem be solved? ------ Solution -------------------- If the field to be sorted is empty, the blank field will be placed first by default. Add a DESC keyword to sort it in reverse order, that is, leave it empty at the end ------ solution ------------------ we recommend that you post: createt mysql field sorting
In an SQL statement, if the field to be sorted is empty, how can this problem be solved?
------ Solution --------------------
If the field to be sorted is empty, the blank field is first by default. Add a DESC keyword to arrange it in reverse order, that is, the empty keyword at the end.
------ Solution --------------------
We recommend that you post:
Create table .......
Insert into table .......
And expected results.
------ Solution --------------------
ORDER by isnull ('field to be sorted by value ')
You can leave the blank column behind. do you mean this?
------ Solution --------------------
(... WHERE field name is not null group by field name)
UNION (... WHERE field name is null)
......
------ Solution --------------------
... Order by sorting field = ''or sorting Field id null, sorting field
------ Solution --------------------
Why is the field empty? try to leave it blank when creating a table.