-
使用 Group 方法解决问题查看全部
-
Where (case when b.skill is not null then 1 else 0 end) +(case when c.skill is not null then 1 else 0 end) +(case when d.skill is not null then 1 else 0 end) +(case when e.skill is not null then 1 else 0 end)>=2;查看全部
-
use test查看全部
-
Select a.user_name,b.skill,c.skill,e.skill From user1 a From user1 a Left join user1_skill b on a.id =b.user_id and b.skill='念经' and b.skill level>0 Left join user1_skill c on a.id = c.user_id and c.skill='变化' and c.skill_level>0 Left join user1_skill d on a.id = d.user_id and d.skill = '腾云' and c.skill_level>0 Left join user1_skill e on a.id = e.user_id and e.skill = '浮水' and e.skill_level>0 ;查看全部
-
select a.user_name,b.skill,c.skill,d.skill from user1 a join user1_skills b on a.id =b.user_id and b.skill='念经' join user1_skills c on c.user_id=b.user_id and c.skill='变化' join user1_skills d on d.user_id =c.user_id and d.skill=‘腾云’ where b.skill_level>0 and c.skill_level>0 and d.skill_level>0;查看全部
-
使用 join 的实现方式查看全部
-
select a.user_name,b.skill,b.skill,b.skill_level from user1 a join user1_skills b on a.id =b.user_id;查看全部
-
select a.user_name,b.skill,c.skill from user1 a join user1_skills b on a.id = b.user_id and b.skill='念经' join user1_skills c on c.user_id=b.user_id and c.skill='变化' where b.skill_level>0 and c.skill_level>0;查看全部
-
select a.user_name,b.skill,b.skill_level from user1 a join user1_skills b on a.id =b.user_id where skill in ('变化','念经') and skill_skill>0;查看全部
-
同一属性的多值过滤查看全部
-
select a.user_name,b.timestr,kills from user1 a join user_kills b on a.id=b.user_id where (b.user_id,b.kills) in (select user_id,max(kills)from user_kills group by user_id);查看全部
-
MYSQL中独有的多例过滤方式查看全部
-
select user_id,max(kills) as cnt from user_kills group by user_id; select a.user_name,b.timestr,kills from user1 a join user_kills b on a.id =b.user_id join (select user_id,max(kills) as cnt from user_kills group by user_id) c on b.user_id=c.user_id and b.kills = c.cnt;查看全部
-
select a.user_name from user1 a join user_kills b on a.id =b.user_id; select distinct a.user_name from user1 a join user_kills b on a.id =b.user_id;查看全部
-
select * from user_kills;查看全部
举报
0/150
提交
取消