I have 3 columns in my db table, I need to multiply column, itm_count & itm_price and output the total for a given id(itm_id).
SELECT sum(itm_price * itm_count) as total FROM ods_temporder WHERE itm_id='11'
I tried to do this using the above sql query, but the result was null. What seems to be the issue here?
What do this give you?
SELECT itm_price, itm_count FROM ods_temporder WHERE itm_id='11'
Is either of itm_price or itm_count NULL? Do you have rows for itm_id = 11?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With