Hi All,
I have below SQL, which is concatenating the ShortCode column data, but without 
ordering as per the ORDER_NUMBER column in ABC table in "WITH" clause.
Please help.

With TBL_SHORT_CODE (SHORT_CODE, FK_KEY) As (SELECT Distinct(XYZ.SHORT_CODE) As 
SHORT_CODE, ABC.FK_KEY From ABC Join XYZ On ABC.PK_KEY = XYZ.FK_KEYwhere 
XYZ.FK_KEY = '{009DA0F8-51EE-4207-86A6-7E18F96B983A}' And ABC.STATUS_CODE = 
1Order By ABC.ORDER_NUMBER)

SELECT LIST(Distinct(TBL_SHORT_CODE.SHORT_CODE), '' ), ABC.FK_BOMFrom ABC Join 
XYZ ON ABC.FK_KEY = XYZ.PK_KEY Join TBL_SHORT_CODE On TBL_SHORT_CODE.FK_KEY = 
ABC.FK_KEYwhere ABC.FK_BOM = '{009DA0F8-51EE-4207-86A6-7E18F96B983A}' And 
ABC.STATUS_CODE = 1Group By ABC.FK_BOM
Thanks In Advance.
With Best Regards.
Vishal

Reply via email to