有三个表(列名称在括号中):
中的user_table (user_id、social_site)
no of user | social site | no of payment successful
34 | fb | 10
"no of user":查找与"fb“和"payment”相关的计数(User_id)(当order_id = booking_id,payment_status=“成功”时)
发布于 2018-06-20 03:40:57
在USER_TABLE (您的第一个表)和另外两个表之间没有连接,所以下面的查询肯定不会工作,但可能会让您知道如何做(一旦您设法修复了错误)。
select count(*)
from user_table u join ??? on ??? --> what goes here?
--
booking_confirm b join payment_table p on b.booking_id = p.order_id
where u.social_site = 'fb'
and p.payment_status = 'success'
https://stackoverflow.com/questions/50934523
复制相似问题