gpt4 book ai didi

php - Mysql连接两个表后按日期多列排序

转载 作者:搜寻专家 更新时间:2023-10-30 20:26:25 25 4
gpt4 key购买 nike

<分区>

enter image description here

现在我想在 2015-08-04 中,2015-08-04 的中间列应该在同一行顺序上,2015-08-05 应该在两列中下降,就像两个日期匹配它们应该在相同的顺序就像两列的顺序它可能像分类帐格式我的 sql 查询

SELECT i.* , it.name AS type,td.qty AS issue, td.is_from_stock AS issue_qty_type,v.name AS vendor,o.name AS branch,td.date_from AS issue_date,l.name AS location,td.user AS user,td.remarks AS remarks, os.opening_quantity AS initial_stock,os.remaining_stock AS opening_quantity,os.opening_quantity_unit_price As opening_unit
FROM ". $this->tbl_inventories ." AS i
LEFT JOIN ". $this->tbl_inventorytypes ." AS it ON i.type_id = it.id
LEFT JOIN ". $this->tbl_distribution ." AS td ON td.item_id = i.item_id AND td.user_branch = i.user_branch

我喜欢 ORDER BY purchased_date,td.date_from

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com