Skip to content
Advertisement

How to add “or” in SQL select query?

I am creating a report to get customer wise incoming payment in a particular period. Payment can be received through Cheques, Direct Bank Transfers, Cash. This payments saved in the database in a separate column like cheques in “CheckSum” column,Cash amount in “cash sum column”.

My question is how to get payment amount from any kind of payment type in to a single column. Following query I used to get values and I just add “or” there to get an idea.

Final output should display as follows

enter image description here

Advertisement

Answer

Following expression should do it (assuming other columns are NULL or zero):

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