anyone know SQL?
I need to find the description and weight that is less than 5, AND greater than 10. I can'tseem to do it with one command though, so I had to use:
select description, weight from product where weight < 5;
select description, weight from product where weight > 10;
how can I merge that into one command?
select description, weight from product where weight < 5;
select description, weight from product where weight > 10;
how can I merge that into one command?
Your trying to find something that is less than 5 and greater than 10 at the same time? I can't tell you regardless of the SELECT statement, your never going to get any results. You can use AND and OR operators like reno stated though to combine them. I don't know if you need the () though.
__________________
Andy - Reinstated Hybrid Forum Moderator
'06 Subaru Legacy Spec B - Stock, for now
'98 Civic EX - CTR headlights and grill, Kosei K1's, for sale
'90 240SX - SR20DET that will never get installed, project car.
Andy - Reinstated Hybrid Forum Moderator
'06 Subaru Legacy Spec B - Stock, for now
'98 Civic EX - CTR headlights and grill, Kosei K1's, for sale
'90 240SX - SR20DET that will never get installed, project car.
Originally Posted by reno96teg
select description, weight from product where (weight < 5 OR weight > 10);
Originally Posted by flipped cracka
yes, looks good to me. i wouldn't use the () though, but that's just me.
Originally Posted by Andy
Your trying to find something that is less than 5 and greater than 10 at the same time? I can't tell you regardless of the SELECT statement, your never going to get any results. You can use AND and OR operators like reno stated though to combine them. I don't know if you need the () though.


