MySQL UNION Omitting Duplicate Results
I was trying to UNION two SELECT queries but for some reason it seemed to be omitting duplicate results (the primary key wasn’t included in the SELECTed columns so some had everything but that in common) as if they were SELECT DISTINCT queries. To work around that I added rand() as the last SELECTed item and it worked. This is probably an ugly hack, but it did what it was supposed to do. One could probably just as easily include the primary key. I still don’t know why it was omitting duplicates and now that it works I probably won’t look into it for a while.