View Single Post
Old 01-13-2005, 10:44 AM   #1 (permalink)
welshbyte
Insane
 
Location: Wales, UK, Europe, Earth, Milky Way, Universe
[SQL] Usage of DISTINCT

Just a quick one really...

If i have the statement:
Code:
SELECT DISTINCT t1.column1, t2.column2 
FROM myTable1 t1, myTable2 t2

--etc
Are t1.column1 and t2.column2 both made to be distinct or would there be repetitions in column2? If not, how would i go about making t1.column1 distinct but still have repetitions in t2.column2?

Background: I'm trying to select the last five posts from a forum database but i dont want to show more than one post from the same subforum but if all of the last 5 posts were by the same person on different subforums i still want to show them.

I'll thank you later
__________________
There are only two industries that refer to their customers as "users". - Edward Tufte
welshbyte is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76