sql - Need help with Join -


So I'm trying to create a simple platform. This list of topics is either the date of the topic in descending order (if any No answer) or in the latest reply. Here is the DB structure:

topic
id, subject, date, poster

mail
id, topic_id, message, date, poster

The forum will contain an HTML table with the following headers:
topics | Last post | Answer:

What will be the query or questions to produce such a structure? I was thinking that it would include a cross join, but not sure ... thanks in advance.

Of course you can do a query for this, but I will give you the subject table field 'replies 'And' last post ', then update them on every new post. It can actually increase the speed of your database, not now, but at the time when you have thousands of topics.


Comments

Popular posts from this blog

c++ - Linux and clipboard -

What is expire header and how to achive them in ASP.NET and PHP? -

sql server - How can I determine which of my SQL 2005 statistics are unused? -