Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ID | Name | Value
- ------------------
- 123,Manufacturer,Dell
- 123,Model,Latitude E5450
- 456,Manufacturer,HP
- 456,Model,ProBook 450 G3
- ID|Manufacturer|Model
- 123,Dell,Latitude E5450
- 456,HP,ProBook 450 G3
- SELECT MainTable.ID,
- mtManufacturer.Value as 'Manufacturer',
- mtModel.Value as 'Model'
- FROM MainTable
- JOIN MainTable mtManufacturer ON MainTable.ID=mtManufacturer.ID AND mtManufacturer.Name='Manufacturer'
- JOIN MainTable mtModel ON MainTable.ID=mtModel.ID AND mtModel.Name='Model'
- ID|Manufacturer|Model
- 123,Dell,Latitude E5450 --good
- 123,Dell,ProBook 450 G3 --bad
- 456,HP,Latitude E5450 --bad
- 456,HP,ProBook 450G3 --good
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement