Skip to content

SQL Server : sum and multiplies on 2 tables

I need help to SUM and MULTIPLIES on join 2 tables: tb1 tb2 In tb1, I need to sum QTY and multiples SKU with PRICE without repeating same SKU (21135208, 21035621): Current query: My result is: Expected result is: Answer I believe that you could filter out duplicates by using a subquery like SELECT DISTINCT &#…

How to write a query with WHERE with two conditions

Right now I have: WHERE flag_1 NOT IN (“D”) AND flag_2 NOT IN (“D”) I have two sets of people working on the same data, and once one group is completed they will “flag” it D, but the report will …

Count child members from parent value

I have a table like conversations and conversation_timelines conversations table example | id | last_active | category_id | |——————————————-| | 1 | …