Skip to content

Tag: tsql

From 2 tables, get rows unique to each table

Starting with 2 tables, I want to get all rows with value in a certain column(cName) that is present on 1 table but not the other. I want to do this for both tables. I found a solution to use LEFT JOIN which gives me solution for 1 of the tables and I used UNION to combine. Is this a

Get max of sum during joining two tables

I want to get the subscriber that has maximum value of Bill (Total Bill). I tried using the following script but SQL did not execute successflly. Please help me on what I did wrong on this. I have 2 tables: Subscriber FirstName MIN Ben 258999542 Reed 458524896 Steve 586692155 Clint 1007772121 Frank 1287548752…

SQL Pivot and get column row data

I have tables and data as below. Trying to get the Manufacturer and the questions they answered by joining and pivot but able to. Added the expected output at the end but no luck. Any suggestions are …