The leader in industrial automation and control solutions

How to reverse an SQL table using advanced mode?

Tags:

  • cMT
  • SQL
  • HMI

NOTE: Advanced mode is required to reverse the order on the SQL Table.

By default the SQL Query Result Viewer will visualize data in ascending order. To change it to descending order will require enabling Advanced Mode under [Data/History] > [SQL Query] > double click on an SQL Query instance > Enable [Advanced Mode].

Once [Advanced Mode] is enabled a dialog message will populate EBPro:

    advanced_mode

    Click “Yes” to continue.

    Navigate to the [Command] tab > double click “Read” or any of the other operations. For this example we are using “Read”.

    The SQL Query content is as follows:
    SELECT data_index, time@timestamp, data_format_0, data_format_1, data_format_2 FROM hostname_log000_data;.

    This in return will present data in ascending order:

    ascending order

    We can descend the information by adding:
    ORDER BY data_index DESC; to the end.

    The SQL Query content will be as follows:
    SELECT data_index, time@timestamp, data_format_0, data_format_1, data_format_2
    FROM hostname_log000_data
    ORDER BY data_index DESC;
    This in return will present data in descending order:

    desc_order

    Content created by Support Team