Skip to Content
0
Jul 02, 2019 at 07:32 AM

How to Use ORDERBY in the flexible serach query (UNION)

266 Views

Hi Experts, I am trying to create flexible search query something as below :

 SELECT uniontable.PK FROM
 (
    {{
       SELECT {p:PK} AS PK FROM {Product AS p}
       WHERE {p.code} = ?code
    }}
    UNION ALL
    {{
       SELECT {p:PK} AS PK FROM {Product AS p}
       WHERE {p.code} = ?code
    }}
 ) uniontable

Can anyone throw some light on how to use "ORDER BY " creation time of product keyword in above query?