使用bito处理数据

通过数据库找出只有一个还款类型的借据

SELECT due_bill_no ,COUNT(due_bill_no)  from acc_repay.receipt_detail rd 
WHERE project_no = 'WS10043190001' 
AND due_bill_no IN ( 
  SELECT due_bill_no 
  FROM acc_cus.cus_user_base 
)  
AND repay_date = '2023-09-12'
GROUP BY due_bill_no
HAVING COUNT(due_bill_no) < 2;

image

使用bito帮助处理数据

添加逗号
image

image
压缩成一行
image

在SQL中使用

SELECT * from acc_repay.receipt_detail rd 
WHERE project_no = 'WS10043190001' 
AND due_bill_no IN (1000003461,1000042256,1000045852,1000046436,1000046638,1000046715,1000046762,1000046825,1000046838,1000047475,1000047523,1000047535,1000047596,1000047630,1000047650,1000047701,1000047737,1000047785,1000047918,1000047925,1000047927,1000047942,1000047948,1000047958,1000047963,1000048005,1000048024,1000048050,1000048061,1000048079,1000048081,1000048548,1000048923,1000049178)
AND repay_date = '2023-09-12';
posted @ 2023-10-18 09:52  捷后愚生  阅读(16)  评论(0编辑  收藏  举报