EasyCFM.COM ColdFusion Forums / Coding Help! / need Help wit SQL querry

Discussion is Locked.This discussion has been locked by Webmaster. << previous || next >> 
Posted By Discussion Topic: need Help wit SQL querry

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

7R4C3
02-22-2004 @ 12:24 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 32
Joined: Jan 2004

<cfquery name="qMessageQuery" datasource="DB">
SELECT
a.id, a.formid, a.thread, a.subject, a.date, b.USER, b.ID
FROM message a, Contacts b
WHERE a.id = a.thread
AND a.date = Max(a.date)
order by a.date DESC
</cfquery>
ignore table b

in my table i have columns

ID THREAD MESAGE DATE AUTHOR
1    1
2    1
3    1
4    4
5    4
6    6

thats the pattern the new threads and replys get created.

i want to select all the unique threads, the last replyer, the number of how many replys and the last reply date of that thread. is tis possible.
i looked at all the sql commands but dont seem to get the idea.

how do i write sql for that?

can anyone help me?
???

=)

Webmaster
02-22-2004 @ 12:53 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4542
Joined: Jan 2002

Please DO NOT Double post your questions... when someone can reply to your thread they will.. but double posts will be removed.

Original Post:
http://www.easycfm.com/forums/viewmessages.cfm?Forum=12&Topic=3022

Thanks,
Pablo Varando
Team Macromedia Member
=====================================================

This message was edited by Webmaster on 2-22-04 @ 12:53 AM


Website Designed and Developed by Pablo Varando.