New on LowEndTalk? Please Register and read our Community Rules.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.
MySQL help needed
So, I have nasty query on my hands:
The problem is, when there is 2 servers in same location and with same priority and status - my result set duplicates.
Question: how to select only 1 server from servers where server priority and status is equal?
I've tried DISTINCT'ing:
<...>SELECT DISTINCT MIN(priority) FROM servers WHERE status
= 1
No luck.
Comments
Use
GROUP BY server.id
Is there another field on orders you could use to clarify the data? For example, order_date or an ID field, you could select the lower/greater of the field for duplicate entries?
Sir, I owe you a can of beer!