Is there any way in SQL server to get the child records to be displayed as the fields of the select clause of master table?
Suppose a master table Sales and a child table called Purchaseditems.
The SaleId is referenced in the Purchaseitems table.
So for a sale, there are lot of purchase items. If so, how I can write a query to select each sales with its purchased items in the select clause?
This is a kind of dynamic column selection from child table. Is this possible in SQL server?