I'll try to explain the problem, but it may not make sense.
I have a mysql table with columns like id,title,speake r,day,month,yea r, topic etc.
At present, my syntax is [CODE=mysql]select * from files order by year, month, day[/CODE]
What this does is return all the entries as requested. However, initially, when an entry is made, it can have up to 3 distinct topics associated with it. So in the table, id1, id2 and id3 will have exactly the same info in every column except for the topic column.
Obviously, when I run the above select statement it prints out the details for each entry, id1, id2 and id3 as separate entries (as it's supposed to).
What I want is for mysql to look for any entries that are identical except for topic. And then instead of listing all 3 entries, list only 1 entry. When I print to the screen the information on topic, it would say "health, wealth, happiness".
At the moment there are 3 distinct entries. The first will say topic: "health". The second "wealth" etc etc.
I can't just use a select distinct title statement, as its possible that there may be two entries with exactly the same title, but different day, month and year.
Below I've put what it currently prints and what I need it to print. Hopefully someone(s) can interpret my request and point me in the right direction.
Thanks.
Currently:
Title: Making Money
Date: 07/09/28
Topic: money
~~~~~~~~~~~~~~~
Title: Making Money
Date: 07/09/28
Topic: happiness
What I need:
Title: Making Money
Date:07/09/28
Topic: money, happiness
I have a mysql table with columns like id,title,speake r,day,month,yea r, topic etc.
At present, my syntax is [CODE=mysql]select * from files order by year, month, day[/CODE]
What this does is return all the entries as requested. However, initially, when an entry is made, it can have up to 3 distinct topics associated with it. So in the table, id1, id2 and id3 will have exactly the same info in every column except for the topic column.
Obviously, when I run the above select statement it prints out the details for each entry, id1, id2 and id3 as separate entries (as it's supposed to).
What I want is for mysql to look for any entries that are identical except for topic. And then instead of listing all 3 entries, list only 1 entry. When I print to the screen the information on topic, it would say "health, wealth, happiness".
At the moment there are 3 distinct entries. The first will say topic: "health". The second "wealth" etc etc.
I can't just use a select distinct title statement, as its possible that there may be two entries with exactly the same title, but different day, month and year.
Below I've put what it currently prints and what I need it to print. Hopefully someone(s) can interpret my request and point me in the right direction.
Thanks.
Currently:
Title: Making Money
Date: 07/09/28
Topic: money
~~~~~~~~~~~~~~~
Title: Making Money
Date: 07/09/28
Topic: happiness
What I need:
Title: Making Money
Date:07/09/28
Topic: money, happiness
Comment