Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hi i have a table 'forum' with

Status
Not open for further replies.

Ewoud

Programmer
Apr 9, 2003
8
BE
Hi

i have a table 'forum' with
id - topic - user - datum - comment

What i want is a table with only the max date with the corresponding user grouped by the topics
so i can set the last message was post on ... by ...

i found the solution in SQL:
SELECT topic, user, datum
FROM forum t1
WHERE datum = (
SELECT MAX( datum )
FROM forum
WHERE topic = t1.topic
)
But this give a Syntax error in MySQL

Can someone convert it?
Or does anyone know the solution?

Thx,

 
depends how you measure "really slow"

there doesn't seem to be an alternative, does there? i mean, short of upgrading to 4.1

rudy
 
>>Isn't that realy slow?

Sure can be. Depends on how much data you have. As there is no other solution when using Mysql you don't have much choice. (Except using another DBMS that supports basic SQL. For instance postgreSQL which is free and superior to Mysql in almost every aspect.)
 
Yeaah i know but my hosting won't upgrade..
maybe i should run my own server... :)

Thx,
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top