Is there a way to write a select that will return a null value for a row that does not exist?
for example:
Table A
productId - type id - name - value
1 - 1 - Title - "Great Song"
1 - 2 - syntax - verb
1 - 3 - country - USA
1- 4 - state - Michigan
2 - 1- Title - "I don't have a country"
2 - 2 - syntax - noun
I want to have a select that returns
Product ID - Title - Syntax - Country - State
1 - Title - "Great Song"
1 - syntax - verb
1 - country - USA
1 - state - Michigan
2 - Title - "I don't have a country"
2 - syntax - noun
2 - syntax - NULL
2 - country - NULL
For product ID 2, the country and state should still exist but be null in the results.
Thanks
for example:
Table A
productId - type id - name - value
1 - 1 - Title - "Great Song"
1 - 2 - syntax - verb
1 - 3 - country - USA
1- 4 - state - Michigan
2 - 1- Title - "I don't have a country"
2 - 2 - syntax - noun
I want to have a select that returns
Product ID - Title - Syntax - Country - State
1 - Title - "Great Song"
1 - syntax - verb
1 - country - USA
1 - state - Michigan
2 - Title - "I don't have a country"
2 - syntax - noun
2 - syntax - NULL
2 - country - NULL
For product ID 2, the country and state should still exist but be null in the results.
Thanks
Comment