LintCode MySQL 1921. 从不充值的玩家(where not in)

2021-02-19 12:53:44 浏览数 (1)

文章目录

    • 1. 题目
    • 2. 解题

1. 题目

描述 A game database contains two tables, player table and recharge table. Write a SQL query to find all players who never recharge.

样例

https://www.lintcode.com/problem/players-who-never-recharge/description

2. 解题

代码语言:javascript复制
-- Write your SQL Query here --
-- example: SELECT * FROM XX_TABLE WHERE XXX --
select name player from user
where user.id not in
(
    select distinct(user_id) user_id
    from recharge
)

0 人点赞