gpt4 book ai didi

mysql - 使用不同后获得重复项

转载 作者:行者123 更新时间:2023-11-30 01:32:10 25 4
gpt4 key购买 nike

我有三个表,一个是映射故事,即使得到重复的值,我也使用不同的关键字

SELECT
mer.store_name, mpr.`merchant_code` , mpr.`terminal_num` ,
mpr.`rec_fmt` , mpr.`bat_nbr` , mpr.`Card_Type` ,
mpr.`card_num` , mpr.`transaction_date` , mpr.`settle_date` ,
mpr.`approval_code`, mpr.`intnl_amt` , mpr.`domestic_amt` ,
mpr.`transid` , mpr.`upvalue` , mpr.`merchant_trackid` ,
mpr.`MSF` , mpr.`service_tax` , mpr.`edu_cess` ,
mpr.`net_amount` , mpr.`debit_credit_type`, mpr.`UDF1` ,
mpr.`UDF2` , mpr.`UDF3` , mpr.`UDF4` ,
mpr.`UDF5` , mpr.`seq_num` , mpr.`arn_no`
FROM
`mpr_reports` mpr, merchantreports mer, storename_tid sid
WHERE (
mer.Store_Name = sid.Store_Name
AND sid.terminal_num = mpr.terminal_num
AND mpr.`rec_fmt` = 'cvd'
OR mpr.`rec_fmt` = 'bat'
)

最佳答案

考虑将已发布的查询修改为类似这样的内容...

SELECT mer.store_name
, mpr.merchant_code
, mpr.terminal_num
, mpr.rec_fmt
, mpr.bat_nbr
, mpr.Card_Type
, mpr.card_num
, mpr.transaction_date
, mpr.settle_date
, mpr.approval_code
, mpr.intnl_amt
, mpr.domestic_amt
, mpr.transid
, mpr.upvalue
, mpr.merchant_trackid
, mpr.MSF
, mpr.service_tax
, mpr.edu_cess
, mpr.net_amount
, mpr.debit_credit_type
, mpr.UDF1
, mpr.UDF2
, mpr.UDF3
, mpr.UDF4
, mpr.UDF5
, mpr.seq_num
, mpr.arn_no
FROM mpr_reports mpr
JOIN storename_tid sid
ON sid.terminal_num = mpr.terminal_num
JOIN merchantreports mer
ON mer.Store_Name = sid.Store_Name
WHERE mpr.rec_fmt IN ('cvd','bat')
;

关于mysql - 使用不同后获得重复项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17321934/

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