SQL Server showing same column twice with different values

Viewed 35

I'm trying to generate a SQL export. In my export, I need a column (cWertVarchar) several times with different values. Since I cannot use a simple where clause I need to find another way to fill the columns with the specific data.

SELECT
    cArtNr AS 'Seller product ref',
    cBarcode AS 'Barcode',
    'caseroxx' AS 'Brand',
    'Standard' AS 'Product nature',
    '07050W01' AS 'Category code',
    taas.cWertVarchar AS 'Short product label',
    taas.cWertVarchar AS 'Long product label'
FROM
    tArtikel
LEFT JOIN 
    tArtikelAttribut taa ON tArtikel.kArtikel = taa.kArtikel
LEFT JOIN 
    tAttributSprache tas ON taa.kAttribut = tas.kAttribut
LEFT JOIN 
    tArtikelAttributSprache taas ON taa.kArtikelAttribut = taas.kArtikelAttribut

The following attributes from tAttributSprache would bring up different values for the column:

tas.kattribut = '295'
tas.kattribut = '316'
tas.kattribut = '317'
tas.kattribut = '318'

Anyone with a good idea how short and long product label could receive different values?

0 Answers
Related