Skip to content
Advertisement

SQL query how to divide values from two columns from the same table in different condition

Supposed I have some sample data in table_name_a as below:

When I input code ‘00001’ and date ‘20191107’, I need the output as below:

This SQL query must be wrong query, because I got wrong result as below:

Thanks so much for any advice.

Advertisement

Answer

try like below

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement