mysql fixes

I had a query something like this returning many duplicate rows:

SELECT entries.permalink,, … FROM entries, entries2video, video WHERE entries.feedid = ‘1’ AND = entries2video.entryid AND = entries2video.videoid ORDER BY id DESC LIMIT

It turns out the fix was pretty easy: instead of “order by id”, make it “order by” (which makes more sense). I am not sure why, but this fixed the problem of returning duplicate rows.

0 thoughts on “mysql fixes

  1. Wow, MySQL didn’t choke on the ORDER BY id ? probably because (maybe?) of selecting, it was the only id being selected, so it used that for ordering?

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s