Tamer
Tamer

Reputation: 25

Mysql Dividing integer to integer and checking if bigger than 10

http://prntscr.com/30rri1

How can I divide Kills to Deaths and see everyone that has a division more than 10?

SELECT * FROM players WHERE DIV(Kills/Deaths) > 10

I tried this, but no hope..

Upvotes: 0

Views: 105

Answers (2)

exussum
exussum

Reputation: 18550

Just remove the div function.

Col1/col2 will do the division no function needed

Upvotes: 0

trogdor
trogdor

Reputation: 1656

Use simply:

SELECT * FROM `players` WHERE Kills/Deaths > 10

For integer division you can use DIV as an inline operator like this:

SELECT * FROM `players` WHERE Kills DIV Deaths > 10

Upvotes: 1

Related Questions