时间:2021-07-01 10:21:17 帮助过:66人阅读
MD()
是我写的一个获取medoo对象的方法)
MD()->debug()->select('items',[
'[>]items_pic'=>['id'=>'item_id']
],['items.id','items_pic.src'],[
'AND'=>[
'items.uid'=>19,
'items.is_delete'=>0
],
'ORDER'=>'items.id DESC'
])
会输出这句sql语句,跟中文文档说的不一样,最后的order by
没有加上DESC
,这是为什么?实际查出来的数据也的确没有倒序
SELECT "items"."id","items_pic"."src" FROM "items" LEFT JOIN "items_pic" ON "items"."id" = "items_pic"."item_id" WHERE "items"."uid" = 19 AND "items"."is_delete" = 0 ORDER BY "items"."id"
使用(MD()
是我写的一个获取medoo对象的方法)
MD()->debug()->select('items',[
'[>]items_pic'=>['id'=>'item_id']
],['items.id','items_pic.src'],[
'AND'=>[
'items.uid'=>19,
'items.is_delete'=>0
],
'ORDER'=>'items.id DESC'
])
会输出这句sql语句,跟中文文档说的不一样,最后的order by
没有加上DESC
,这是为什么?实际查出来的数据也的确没有倒序
SELECT "items"."id","items_pic"."src" FROM "items" LEFT JOIN "items_pic" ON "items"."id" = "items_pic"."item_id" WHERE "items"."uid" = 19 AND "items"."is_delete" = 0 ORDER BY "items"."id"
"ORDER" => ["item.id"=>"DESC"]