[thelist] MySQL: SELECT DISTINCT ... ORDER BY RAND() bug?

Jay Blanchard jay.blanchard at niicommunications.com
Wed Sep 17 08:26:20 CDT 2003


[snip]
Were you using two tables with a one-to-many relationship of the
joining field? As in

    table 1                  table 2
prodID (p/k)           prodID  inventoryID (p/k)
    100001              100001       1
    100002   ----+-->   100002       2
    100003       +-->   100002       3
    100004       +-->   100002       4

[/snip]

Yes, it was a one to many relationship on the two tables.


More information about the thelist mailing list