MYSQL query with ORDER BY and two LIMITs
Budget: $10 – $15 USD
Hello
I have DB like this
Name chance winner
a 245 0
b 154 0
c 5 0
d 12 0
e 300 0
f 40 1
g 2 0
h 30 0
i 80 0
j 250 1
- I want a qury which gives me top 4 highet chance and top 2 lowest chance
- In total the record should be 6 records
- If winner is flaged 1 then it should not be considred
In above excmple we should get result like
e
a
b
i
c
g
I am using this query but its not working
SELECT * FROM `DB_name` WHERE winner !='1' ORDER BY `chance` DESC LIMIT 4, `chance` ASC LIMIT 2
I have DB like this
Name chance winner
a 245 0
b 154 0
c 5 0
d 12 0
e 300 0
f 40 1
g 2 0
h 30 0
i 80 0
j 250 1
- I want a qury which gives me top 4 highet chance and top 2 lowest chance
- In total the record should be 6 records
- If winner is flaged 1 then it should not be considred
In above excmple we should get result like
e
a
b
i
c
g
I am using this query but its not working
SELECT * FROM `DB_name` WHERE winner !='1' ORDER BY `chance` DESC LIMIT 4, `chance` ASC LIMIT 2