help with sql query to return existing and non existent records

Gary Keramidas 41 Reputation points
2023-03-06T19:23:30.2166667+00:00

i've tried a few example and can't seem to grasp how to do this. can someone help?

this query returns 1 row with the quantity for the item. there are 2 items not currently in inventory, so they're not in the table.

select styl from idcase where (whse = 'FP' and styl IN ('799941', '799950','799981'))

799941 200

how do i write the query so it shows

799941 200

799950 0

799981 0

SQL Server Other
0 comments No comments
{count} votes

6 answers

Sort by: Most helpful
  1. Gary Keramidas 41 Reputation points
    2023-03-07T04:42:40.2166667+00:00

    sorry, no luck. just forget it. i don't want anybody to waste any more time on something that i think should be simple.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.