1
说我有如下表评级:鉴于两个用户,选择每一个岗位两个用户评级,并且每个用户的每一个朝后
create table ratings (
user_id int unsigned not null,
post_id int unsigned not null,
rating set('like','dislike'),
primary key (user_id, post_id)
);
和两个用户,IDS 1和2。我想要了解他们在评分中的赞同程度,所以我需要的是一种选择两位用户评分的所有帖子的方式,以及每位用户对每篇帖子的评分。例如:
+---------+---------+---------+
| post_id | rating1 | rating2 |
+---------+---------+---------+
| 1 | like | dislike |
| 2 | like | like |
| 5 | like | dislike |
| 6 | dislike | dislike |
+---------+---------+---------+
任何线索表示赞赏,谢谢!
灿烂,非常完美!非常感谢,这将在未来帮助我很多。 – Sophivorus 2012-03-09 04:42:35