gpt4 book ai didi

mysql - SQL Join 获取重复项

转载 作者:行者123 更新时间:2023-11-29 06:53:43 25 4
gpt4 key购买 nike

大家好,我收到了重复的第一条记录,并且知道事实上只有一条记录,但它似乎更改了第二条记录的批号。请帮忙:(

SQL

Select A.ID
, A.lotnumber
, A.title
, A.department
, A.seller
, A.buyer
, A.soldfor
, A.status
, B.memberid
, B.paddlenumber
From sessionproducts A
Left
Join buyers B
on B.memberid = A.buyer
WHERE A.auction = 4
AND A.session = 1
ORDER
BY A.lotnumber ASC

返回

+----+-----------+-------------------------------+------------------+--------+-------+---------+--------+----------+--------------+
|ID | lotnumber | title | department | seller | buyer | soldfor | status | memberid | paddlenumber |
+----+-----------+-------------------------------+------------------+--------+-------+---------+--------+----------+--------------+
|85 | 1 | A Pair of Staffordshire | Decorative Arts | 47 | 160 | 600 | Sold | 160 | 317 |
| | | Figures of King Charles Sp... | | | | | | | |
+----+-----------+-------------------------------+------------------+--------+-------+---------+--------+----------+--------------+
|85 | 1 | A Pair of Staffordshire | Decorative Arts | 47 | 160 | 600 | Sold | 160 | 811 |
| | | Figures of King Charles Sp... | | | | | | | |
+----+-----------+-------------------------------+------------------+--------+-------+---------+--------+----------+--------------+

最佳答案

buyers表中,您似乎至少有两条具有相同memberidpaddlenumber不同的记录。

关于mysql - SQL Join 获取重复项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/46514801/

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