I have a query like:
SELECT NUM,
PARAM_1
FROM STOCK_CARD_PARAMETER WITH(NOLOCK)
WHERE FK_STOCK_CARD IN (SELECT FK_sTOCK_CARD
FROM STOCK_BARCODE WITH(NOLOCK)
WHERE BARCODE = '2002002232364' )
And it returns:
NUM PARAM_1
1 İNDİRİMSİZ
2 SEZON
3 UNISEXYETISKIN
I have to get a result like that. (side by side)
İNDİRİMSİZ SEZON UNISEXYETISKIN
To do this, I execute almost the same query 2 times like this:
INDIRIM = (SELECT PARAM_1
FROM STOCK_CARD_PARAMETER WITH(NOLOCK)
WHERE FK_STOCK_CARD IN (SELECT FK_sTOCK_CARD
FROM STOCK_BARCODE WITH(NOLOCK)
WHERE BARCODE = @BARKOD AND NUM = 1)),
STATU = ( SELECT PARAM_1
FROM STOCK_CARD_PARAMETER WITH(NOLOCK)
WHERE FK_STOCK_CARD IN (SELECT FK_sTOCK_CARD
FROM STOCK_BARCODE WITH(NOLOCK)
WHERE BARCODE = @BARKOD AND NUM = 2))
NUM column is the key here. How do I make this two query combined and get the result side by side?