SQL: Selecting columns based on column value from another table

前端 未结 2 857
北恋
北恋 2021-01-03 00:13

I have the following tables:

UserPrivileges: 
+--------+------+------+------+
| UserID | Col1 | Col2 | Col3 |
+--------+------+------+------+
|      1 |    0         


        
2条回答
  •  旧时难觅i
    2021-01-03 00:40

    have not tried it, but something like this should work

    SELECT (SHOW COLUMNS FROM table WHERE expr) FROM data WHERE DataID = '#'
    

    Check this post for details - How can I get column names from a table in Oracle?

    Let us know how you solve this...

提交回复
热议问题