Skip to content
Advertisement

Tag: join

SQL many to many

I have fivetables here: User +——–+———-+ | stu_id | batch-id | +——–+———-+ | 1 | 1 | | 2 | 1 | | 3 | 1 | +——–+———-+ subject_id +-…

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 … FROM tb1, while leaving

Advertisement