Hey, Im having trouble with a single query
I cant really explain this that well.
Im converting an old yabbse database to phpbb2. Except all i have is the .sql file. Im converting the tables in my own mySQL server offline.
The tables Im having trouble with is the topics. Due to yabbse not storing the topic subject with the topic id. (Topic subject is stored with the message/post) .
Sooo. long story short.
I need to extract the first topic subject based on destinct topic ids in the message table.
SELECT distinct ID_TOPIC, subject
Which is my problem, it gets distinct of both columns combined. Can anyone help?
My final select query looks like this atm,
SELECT DISTINCT messages.ID_TOPIC, topics.ID_BOARD, messages.subject, messages.ID_MEMBER, messages.posterTime, topics.numViews, topics.numReplies
FROM messages, topics
WHERE topics.ID_TOPIC = messages.ID_TOPIC;
which does sweetfa until i can get distinct for ID_TOPIC only.
Any DB query gurus out there?