Advertisement
Guest User

Untitled

a guest
Oct 20th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.62 KB | None | 0 0
  1. ID | Name | Value
  2. ------------------
  3. 123,Manufacturer,Dell
  4. 123,Model,Latitude E5450
  5. 456,Manufacturer,HP
  6. 456,Model,ProBook 450 G3
  7.  
  8. ID|Manufacturer|Model
  9. 123,Dell,Latitude E5450
  10. 456,HP,ProBook 450 G3
  11.  
  12. SELECT MainTable.ID,
  13. mtManufacturer.Value as 'Manufacturer',
  14. mtModel.Value as 'Model'
  15. FROM MainTable
  16. JOIN MainTable mtManufacturer ON MainTable.ID=mtManufacturer.ID AND mtManufacturer.Name='Manufacturer'
  17. JOIN MainTable mtModel ON MainTable.ID=mtModel.ID AND mtModel.Name='Model'
  18.  
  19. ID|Manufacturer|Model
  20. 123,Dell,Latitude E5450 --good
  21. 123,Dell,ProBook 450 G3 --bad
  22. 456,HP,Latitude E5450 --bad
  23. 456,HP,ProBook 450G3 --good
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement