LinuxKommy
Technical User
How would i select one value based on another? the table stores its value as "Y" or "N", but i want 1 or 0. if they were numbers, i could perform the operation much more easily.
if anyone can suggest a better way to do this operation, i'd love to hear it because i'm running out of ideas here.
the table stores the flag field and a quantity of items. An example would be:
Flag Stock# Qty
---- ------ ---
Y 560000 2
Y 570000 1
Y 580000 1
I want it to return 4. the grouping occurs on an orderno, and the where clause selects all rows with the flag set to "Y". but i need it to count the quantity in there too? how would i do that?
if anyone can suggest a better way to do this operation, i'd love to hear it because i'm running out of ideas here.
the table stores the flag field and a quantity of items. An example would be:
Flag Stock# Qty
---- ------ ---
Y 560000 2
Y 570000 1
Y 580000 1
I want it to return 4. the grouping occurs on an orderno, and the where clause selects all rows with the flag set to "Y". but i need it to count the quantity in there too? how would i do that?