Skip to content
Advertisement

Return data only for specific condition SQL Server

I need help on my query to display data only for an specific condition.

Here is the query

So in my query I need to add where it should only return those 4 highlighted rows which are 4, so basically it should only return duplicate materialLookupcodes having more than 1 vendorlotlookupcode

enter image description here

Advertisement

Answer

You can do:

Alternatively, it could be shorter to use a window function computing DISTINCT row values, but I don’t think this is implemented in SQL Server [yet].

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