1

Is there a way to dynamically pull column names from select query.

table->country
 (countryID | countryName)

table->countryVars
(countryID | dataKey | dataVal)

basic idea is to get something that this would do so you don't have to case every column name but just add key/val pair to countryVars table

select country.*, countryVars.dataVal as countryVars.dataKey form country
join countryVars on countryVars.countryID = country.countryID

end result should be like this

countryID | countryName | capital  | people | region

1         | Finland     | Helsinki | 5milj  | scandinavia
Bill Karwin
  • 538,548
  • 86
  • 673
  • 828
Piit
  • 21
  • 2

0 Answers0