0

I have a table(validation_number) that contains an unique id and comma separated name of columns: Table is in similar fashion

The column name are the column names of another table(Validation )which I want to show or hide based on the validation number.

I've tried select (select columns from table where validation number=3) from validation, but it has not provided the desired result.

I have also tried storing the result of this query in a variable and calling it in the other query but this also has not worked. Please help.

Charlieface
  • 52,284
  • 6
  • 19
  • 43
  • 3
    Choosing what columns to display or not is a choice for your presentation layer, not the SQL layer. Also, storing delimited data in your database is a very poor choice; normalise your design. – Thom A Nov 06 '21 at 07:40
  • Does this answer your question? [Dynamically choose column in SQL query](https://stackoverflow.com/questions/8454671/dynamically-choose-column-in-sql-query) – Charlieface Nov 06 '21 at 18:47

0 Answers0