Focal Point
[CLOSED] Need help on SELECT statement

This topic can be found at:

May 18, 2017, 08:28 AM
[CLOSED] Need help on SELECT statement

I have requirement like: Need to arrange all rows in table in acsending order and fetch the first row only.

As I am new to Data migrator, Could anyone please help me how to use SELECT object here.


This message has been edited. Last edited by: FP Mod Chuck,

Windows, All Outputs
May 18, 2017, 01:45 PM
If this is for DataMigrator, you should post this question in the iWay Software Product Forum. If this is a WebFOCUS question, you need to use BY HIGHEST 1 FIELDNAME in your code.

WebFOCUS 8206, Unix, Windows
May 22, 2017, 01:36 PM
By "arrange all rows in table in ascending order" do you mean by the key or some other column? And why do you need to do that if you only want the first one? You can get the first (i.e.: lowest valued) row for a column from a WHERE condition with a sub-select.

For example using the DataMigrator sample table dminv to get the row with the least expensive item(s). Add the table to a flow, select the columns you want, then right click on the SQL object and click on the Conditions tab. Then click on the Functions tab and expand "SQL Operators" and click on the last one (SELECT lookup_result...

For LOOKUP_MFD select the same table, for lookup_result type SQ.PRICE then add the condition as shown below.

(SELECT MIN( SQ.PRICE ) FROM ibisamp.dminv SQ ) = T1.PRICE