"select m.*,s.FCity from TuMemberActivity as m INNER join TuStore as s on m.FStoreId=s.FId "
+ "where FActivityStatus='2' order by case when m.FStoreId=? then 0 when s.FCity=? then 1 else 2 end ,FCreateTime DESC";
+ "where FActivityStatus='2' order by case when m.FStoreId=? then 0 when s.FCity=? then 1 else 2 end ,FCreateTime DESC";
本文介绍了一个具体的SQL查询案例,展示了如何通过内连接和条件排序来优化数据库查询效率。该查询涉及活动成员信息与店铺信息的关联,并根据特定条件进行排序。

被折叠的 条评论
为什么被折叠?



