View Single Post
Old 10-04-2012, 12:32 AM   PM User | #3
TGeene
New to the CF scene

 
Join Date: Oct 2012
Location: Las Vegas, NV, USA
Posts: 4
Thanks: 1
Thanked 0 Times in 0 Posts
TGeene is an unknown quantity at this point
Quote:
Originally Posted by Old Pedant View Post
Can you show the result of doing *JUST* the UNION part of that?
Here is the output that I get:
Code:
2 | 1348041600
3 | 1348041600
4 | 1348041600
2 | 1348041601
3 | 1348041602
Quote:
Originally Posted by Old Pedant View Post
And you only show 3 records in the "returns like this". I assume it is actually returning many more?
Right now there is very limited data in the system for basic testing.

Quote:
Originally Posted by Old Pedant View Post
And you apparently misunderstand how SELECT DISTINCT works.

It applies to *ALL* the fields in your SELECT. If *ANY* fields in the two records are different, then the records are different and the DISTINCT will show them.

Putting parentheses around the field name, as you did with
Code:
SELECT DISTINCT(p.postId), p.roomId, ...
is meaningless. It changes nothing. Remove them and you will get identical results.
The only reason I put parentheses around the field name was because I saw it in a tutorial and was trying it out. But like you said, it returns the same as without the parentheses.
TGeene is offline   Reply With Quote