字段 id,userid ,articleid,state (id主键,对应userid,articleid 只有一个state,state只有1,2,3,三个可取值)
例:
id,userid ,articleid,state
1,1,1,1
2,1,2,2
3,1,3,2
4,1,4,3
5,1,5,3
6,1,6,3
7,2,1,1
8,2,2,2
9,2,3,2
10,3, 1,1
………… …… ……
----------------------------------------------
需要查询结果:
userid ,state(1),state(2),state(3)
1,1 ,2 ,3
2,1 ,2 ,0
3,1 ,0 ,0
……………………
-----------------------------------------------
在线急等啊,谢谢了
|