Skip to content
Advertisement

query to get statistic data from SQL server

I have a table named total sales. In this table there are sales data like invoice date and branch name that sells the invoice and the quantity.

I am trying to make a query to get total sales for each branch in every single date and my code is below, but when I execute the code the query returns an error and I cannot determine the condition for every column.

my code :

Advertisement

Answer

Based on your description, what you wanted should be

You can use branche_name in ( 'branch1' , 'branch2' ) or WHERE branche_name = 'branch1' OR branche_name = 'branch2' for filtering the 2 branches that you need.

As for the malqaStore and tahliaStore, my guess is you wanted a condition sum on the quantity for each of the branche_name

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