Table column Sort with nulls, change to space?

Questions and answers regarding general SQL and backend databases

Table column Sort with nulls, change to space?

Postby joe26 » Mon Jun 24, 2019 4:14 pm

Hi,

Is there a way within Query Builder to perform an operation on columns that results in the display of spaces?

When a column is resorted by selection, all null items appear at the top of the sort. In the case of nulls, those null values sort first.
Real data always shows at the bottom of the table. Can calculations be used?

Has anyone seen and resolved this issue?

thanks,
--Joe.
joe26
 
Posts: 114
Joined: Wed Jun 19, 2013 10:30 pm

Re: Table column Sort with nulls, change to space?

Postby rgansevles » Fri Jul 05, 2019 9:25 am

Joe,

This may be achieved by changing the collation on your database.

You cannot use calculations in QueryBuilder.

In QueryBuilder, you could sort on values using the nullif function:
Code: Select all
query.sort.add(query.columns.mycol.nullif('').asc)


Hope this helps,

Rob
Rob Gansevles
Servoy
User avatar
rgansevles
 
Posts: 1894
Joined: Wed Nov 15, 2006 6:17 pm
Location: Amersfoort, NL


Return to SQL Databases

Who is online

Users browsing this forum: No registered users and 3 guests