我正在尝试如下创建灵活的搜索查询:
SELECT uniontable.PK FROM
(
{{
SELECT {p1:PK} AS PK FROM {Product AS p1},{Product AS p2}
WHERE {p1.code} = {p2.Att1}
}}
UNION ALL
{{
SELECT {p:PK} AS PK FROM {Product AS p}
WHERE {p1.Att1} is not empty
}}
) uniontable
有人可以告诉我如何在上述查询中使用产品关键字的“ ORDER BY”创建时间吗?
答案 0 :(得分:0)
尝试一下,它更简单:
SELECT {p1:PK} AS PK FROM {Product AS p1},{Product AS p2} WHERE {p1.code} = {p2.Att1} AND {p1.Att1} is not empty ORDER BY {p1.creationtime}
希望这会有所帮助