が重複しない3つのテーブルを結合するI持っMySQLは値
--subscribers--
id
name
e-mail
--categories--
id
subscriber_id
cat1
cat2
... so on
--messages--
id
title
message
cat1
another field
...
私のクエリは、タイトル、メッセージ及び加入者のメールを返す必要があり、次の表。すべての加入者は多くのメッセージを受け取ることができます。
私のクエリは、重複した電子メールを返します。私が取得したいと思います:
e-mail1 - title1, message1
e-mail2 - title1, message1, title2, message2 so on
e-mail3 - title1, message1, title2, message2, title3, message3
は今、私が持っている:
e-mail1 - title1, message1
e-mail2 - title1, message1
e-mail2 - title2, message2
e-mail3 - title1, message1
e-mail3 - title2, message2
どのようにしてくださいDELAか?助けてくれてありがとう。
あなたはachiveことができるhttp://dev.mysql.com/doc/refman/5.0/en/group-([GROUP_CONCAT]により、 by-functions.html#function_group-concat)。しかしあなたの質問を見ることなく... –