Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

Query for Merged Data

$
0
0

hi,

  I have table called Table1 with the following structure and data

Table1

------------

ID                Ref No         Name        Quantity

1                    0001         N1                 100

2                                     N1                 150

Here i have the same item but one is based on reference number and one is not referenced. I need output as 1 row and Quantity as 2 columns namely Referenced Quantity and UnReferenced Quantity

Expected Output:

ID     Name   ReferencedQuantity  UnReferencedQuantity

1       N1                  100                       150


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>