Skip to content
Advertisement

SQL SELECT from based on truth table

How can I select the columns to be returned by a lookup truth table? my data:

the lookup table

someting like SELECT from data (columns which have "true" in lookup) resulting in:

Advertisement

Answer

use a pivot table

Schema (MySQL v5.7)


Query #1

There are no results to be displayed.


Query #2

There are no results to be displayed.


Query #3


There are no results to be displayed.


View on DB Fiddle

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement