SQLite Select data where the column name contains a string?

末鹿安然 提交于 2021-01-29 12:48:18

问题


I am trying to get data from columns containing a particular string in their name. I have found the answer for MySql MySQL: Select Column names containing a string but I need to do the same query for SQLite. Any suggest?


回答1:


Since SQLite 3.16, you can use PRAGMAs in queries:

SELECT name
FROM pragma_table_info('MyTable')
WHERE name LIKE ...


来源:https://stackoverflow.com/questions/50043164/sqlite-select-data-where-the-column-name-contains-a-string

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!