There is probably no performance difference between inserting 1 big row with 
repeated data from *up to* (how do you know how many?) 64 satellites and 
inserting *up to* 64 records with identical timestamps WITHIN A SINGLE 
TRANSACTION.

This will eliminate your need for wildcard matching of column names.

SELECT timestamp,count() FROM satellite_data WHERE SNR > 30 GROUP BY 1;

And if you do need a list of satellites as a single string, just use 
group_concat().

-----Ursprüngliche Nachricht-----
Von: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] Im 
Auftrag von Mukesh Kumar
Gesendet: Freitag, 08. Juni 2018 12:53
An: SQLite mailing list <sqlite-users@mailinglists.sqlite.org>
Betreff: [EXTERNAL] Re: [sqlite] Selecting multiple similar columnname.

Hi Ryan,

Thanks for the advice.
I cant share the exact Schema, however i can give an idea.

I am trying to store GNSS satellite info, which is streaming every second.
My Primary Key is the Timestamp at which i have got the information.. And other 
columns in the table are the satellite information like 
SNR,elevation,abc,def,ghi...... for each of the satellite.
max number of satellite at a given timestamp can be 64.
So in my schema, all the satellite parameters are getting repeated 64 times.

I want a easy way to extract the data, lets say get timestamp when any of the 
satellite has SNR > 30.

My Idea was to write a simple query like

Select SNR* from Table where SNR*> 30;
where * takes value from 1-64.

Could you please suggest how to handle such scenarios ?

Regards
Mukesh




P* Please don't print this e-mail unless you really need to.*

On Fri, Jun 8, 2018 at 3:35 PM, R Smith <ryansmit...@gmail.com> wrote:

>
> 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
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users


___________________________________________
 Gunter Hick | Software Engineer | Scientific Games International GmbH | 
Klitschgasse 2-4, A-1130 Vienna | FN 157284 a, HG Wien, DVR: 0430013 | (O) +43 
1 80100 - 0

May be privileged. May be confidential. Please delete if not the addressee.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to