Francesco G.
Francesco G.

Reputation: 717

SQLite Select data where the column name contains a string?

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?

Upvotes: 0

Views: 1290

Answers (1)

CL.
CL.

Reputation: 180020

Since SQLite 3.16, you can use PRAGMAs in queries:

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

Upvotes: 1

Related Questions