On 2018/06/07 6:11 PM, mukeshkb4u wrote:
Hi All,
I have a table with multiple similar column names, like
abc_1,abc_2,abc_3.......

Is there a way i can do a select on only these columns in a table, without
specifiying the full column list?
Can i use  a regular expression in selecting column names ?

There is no such way, and shouldn't be. You could achieve this by writing a pre-processor on your sql queries, but honestly my advice for simplest solution - make a view showing only the specific set of columns and then query that view when needed - perhaps even joining that view to the original table if you wish to add one or two other columns.

That said, I would like to reiterate Simon's point - If you have that many similar columns, it suggests a schema with scope to improve.  If you post the whole schema and its purpose/description, someone here might be able to suggest an easier/better way to do it.

Cheers!
Ryan

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to