Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
452 views
in Technique[技术] by (71.8m points)

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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Since SQLite 3.16, you can use PRAGMAs in queries:

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...