Skip to content

Tag: sql-order-by

SQL Order By on multiple columns containing Nulls

I have a table containing multiple columns, and I want to order by three of the columns within the table. I want to order by lot, then unit, and lastly number. Lot and Unit can contain nulls (need them listed at the bottom) whereas Number column does not contain Null. I’ve tried a bunch of case statemen…

there is a way to order empty element like null element?

I need to order a column and there are a lot of elements null or empty.The problem is null element are ordered differente from null element The result about is that employees with name==null are the first position, after there are the elements with name!=null (are a real name) and at the end there are the ele…