Question

How do you check if the content of a field is a multiple of 2 in oracle sql

n_id     |     n_content
-------------------------
1        |     Balloon
2        |     Drill
3        |     Cup
4        |     Bottle            
5        |     Pencil
6        |     Ball

I have tried:

select*from num_w where (n_id%2>0);

and also

select*from num_w where n_id%2=0;

Neither of these worked

Was it helpful?

Solution

Wasn't this multiple of 5 a few seconds ago? :)

Anyway, in Oracle I believe the query would be:

select * from num_w where MOD(n_id,2) = 0;
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top