I have a very simple SQL question. I have a database table with the following columns:
Part Number
Sales Type (for simplicity, call it Sales Type 1,2,3,4,5)
I am hoping to write a query that gives the following three columns:
- The part number
- The total number of sales for Sales Type = 2
- The total number of sales for Sales Type <> 2
I can easily get two of the three columns to display with code similar to the code below but I'm stumped on how to get all three to show up at the same time.
SELECT
PartNumber AS PartNumber,
COUNT(*) AS SalesCount
FROM
SalesTable
WHERE
SalesType = 2
GROUP BY
I.PartNumber
I'm guessing this may be very easy - I'm a SQL noob and this is my first post!
Any help is greatly appreciated!