摘要:
leetcode 1141 查詢進30天活躍用戶數 select activity_date as day , count(distinct user_id) as active_users from Activity a where activity_date between DATE_SUB(' 阅读全文
摘要:
leetcode 1084 销售分析III select distinct p.product_id, p.product_name from Product p left join Sales s on p.product_id = s.product_id where s.product_id 阅读全文
摘要:
leetcode 1045 买下所有产品的客户 select customer_id from Customer c left join Product p on c.product_key = p.product_key group by customer_id having count(dist 阅读全文
摘要:
leetcode 626 換座位 SELECT (CASE WHEN MOD(id, 2) != 0 AND counts != id THEN id + 1 WHEN MOD(id, 2) != 0 AND counts = id THEN id ELSE id - 1 END) AS id, s 阅读全文
摘要:
leetcode 619 只出現一次的最大數字 select max(num) as num from ( select num as num from MyNumbers group by num having count(num) = 1 ) as mn select if(count(num) 阅读全文
摘要:
樹節點 select id, 'Root' as Type from tree where p_id is null union select id, 'Inner' as Type from tree where id in ( select distinct p_id from tree whe 阅读全文
摘要:
銷售員 select s.`name` from salesperson s left join orders o on s.sales_id=o.sales_id left join company c on o.com_id=c.com_id and c.name='RED' group by 阅读全文