Jump to content

(Pages) Cast number fields


Recommended Posts

In Pages, we can create a field with a type Number. The field is created as VARCHAR in MySQL. This does not allow us to sort by this field with correct alphanumeric order.

The sorting by this field results in:

  • 1
  • 10
  • 2
  • 42
  • 9

You have to cast the values if ordered by this field

SELECT * FROM table_name ORDER BY CAST(field_name as SIGNED INTEGER) ASC

EDIT: I mean the sorting in record feed block or getItemsWithPermission.

Edited by Sonya*
Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...