我准备了一个灵活的搜索查询。在这里,我开发了一个条件,如:
订单状态在订单中完成
以及按顺序出现的订单条目
获取 orderentries 中的产品
为此我写了一个查询
select {p.pk} from {
order as o
join OrderStatus as os on {os.pk}={o.status}
join orderentry as oe on{oe.order}={o.pk}
join product as p on {oe.product}={p.pk}
}
where {os.code}='COMPLETED'
AND {o.date}>'2020-08-16 00:00:00.000' AND{o.date}<'2020-09-30 00:00:00.000'
group by{p.pk} order by count({oe.pk}) desc limit 10
在这个查询中,我想要的是我想获取所有产品信息,比如
select * from Product}
如何修改此查询获取所有产品?