Mysql - How to multiply zero n non zero columns, Multiply zero and non zero columns in mysql
How to multiply zero n non zero columns
How to multiply zero and non zero columns in mysql?If the quantity field is less than '1', then its value is considered as(quantity= 1)
SELECT itemname,amount,quantity,(amount*(CASE WHEN quantity <=0 THEN 1 ELSE quantity END ) ) as total from your_tablename
itemname | amount | quantity | total ----------------------------------------- Soap | 40.00 | 1 | 40.00 Oil | 55.00 | 0 | 55.00 powder | 60.00 | 2 | 120.00
You can make mysql calculation for zero and non zero columns in mysql using the above query.
The topic on Mysql - How to multiply zero n non zero columns is posted by - Math
Hope you have enjoyed, Mysql - How to multiply zero n non zero columnsThanks for your time