Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 40e3413

Browse files
多属性查询
1 parent 82b2e1c commit 40e3413

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

‎mysql开发技巧三/多属性查询‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,11 @@ Where (case when b.skill is not null then 1 else 0 end)
2929
+(case when d.skill is not null then 1 else 0 end)
3030
+(case when e.skill is not null then 1 else 0 end)>=2;
3131

32+
********************************************************************************
33+
Group by 分组 查询多属性
34+
35+
select a.user_name
36+
from user1 a
37+
join user1_skills b on a.id=b.user_id
38+
where b.skill in('念经','变化','腾云','浮水') and b.skill_level>0
39+
group by a.user_name having count(*)>=2

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /