Re: [sqlite] Optimise select from attached databases

2009-09-28 Thread Andrew Gatt
P Kishor wrote: > On Mon, Sep 28, 2009 at 12:06 PM, Andrew Gatt <a.g...@btinternet.com> wrote: > >> I'm trying to optimise a select statement, but from multiple attached >> databases. The general statement would be; >> >> SELECT * FROM database0.table WHE

[sqlite] Optimise select from attached databases

2009-09-28 Thread Andrew Gatt
I'm trying to optimise a select statement, but from multiple attached databases. The general statement would be; SELECT * FROM database0.table WHERE id = 1; Where i have a long list of ids to retrieve, which could be from any of the attached databases. With a single database i would prepare the

Re: [sqlite] Table Exists Query

2009-08-15 Thread Andrew Gatt
Simon Slavin wrote: > On 15 Aug 2009, at 3:12pm, Andrew Gatt wrote: > > >> but by my scheme you can't be sure if the list_1 table exists in >> database2, >> > > Add a column to your 'lists' tables which says which database they're > part of. So

Re: [sqlite] Table Exists Query

2009-08-15 Thread Andrew Gatt
Roger Andersson wrote: > > I have multiple databases, both have a table called "lists" inside this > table is the names of other tables in the database that make up the lists. > Each individual list is made up of the tables that have the same name in > each database (the list is split between

[sqlite] Table Exists Query

2009-08-15 Thread Andrew Gatt
Hi all, I have multiple databases, both have a table called "lists" inside this table is the names of other tables in the database that make up the lists. Each individual list is made up of the tables that have the same name in each database (the list is split between different storage devices in

Re: [sqlite] Temporary Table Speed Up Select

2008-10-28 Thread Andrew Gatt
Thomas Briggs wrote: >How much slower is the index than your pre-populated table? If > you're really comparing apples to apples it would be good to know how > big the different is. > >If you post your schema and queries you'll probably get better > advice. At that this I'm just guessing.

Re: [sqlite] Temporary Table Speed Up Select

2008-10-28 Thread Andrew Gatt
Thomas Briggs wrote: >Ultimately it'll depend on your schema and the query you're > running, but you're probably better off creating an index that covers > the SELECT query you're executing. That should make the query fast > and save you the hassle of writing and maintaining triggers. > >

[sqlite] Temporary Table Speed Up Select

2008-10-27 Thread Andrew Gatt
My program uses a relatively slow select statement to get the rows the program needs. This is done very often, but updates, inserts and deletes are done very infrequently. My idea was to create a temporary table with the result of this select statement, then create triggers from the main table

Re: [sqlite] Multiple Selects

2008-10-19 Thread Andrew Gatt
MikeW wrote: > Andrew Gatt <[EMAIL PROTECTED]> writes: > > >> I'm not sure if i'm missing something, but is there an efficient way of >> retrieving multiple rows based on different conditions in order. For >> example i have a table with rows of id

Re: [sqlite] Ignoring "The"

2008-07-23 Thread Andrew Gatt
Dennis Cote wrote: > Andrew Gatt wrote: > >> Error: wrong number of arguments to function substr() >> >> I'm using sqlite 3.3.6, but i'm presuming the two and three variable >> substr functions go back further than this? Doing tests it seems to be >> the

Re: [sqlite] Ignoring "The"

2008-07-23 Thread Andrew Gatt
Dennis Cote wrote: > Andrew Gatt wrote: > >> I have a table of music artist names which i'd like to output in order. >> Normally i just use: >> >> select * from artists order by artist_name; >> >> What i'd really like to do i

Re: [sqlite] Ignoring "The"

2008-07-23 Thread Andrew Gatt
>> I have a table of music artist names which i'd like to output in order. >> Normally i just use: >> >> select * from artists order by artist_name; >> >> What i'd really like to do is order the artists by name but ignore any >> "the" or "the," preceding it. >> >> Any ideas? >> >> Thanks >> >>

[sqlite] Ignoring "The"

2008-07-23 Thread Andrew Gatt
I have a table of music artist names which i'd like to output in order. Normally i just use: select * from artists order by artist_name; What i'd really like to do is order the artists by name but ignore any "the" or "the," preceding it. Any ideas? Thanks Andrew

Re: [sqlite] Results even if no rows

2006-07-13 Thread andrew gatt
> "andrew gatt" <[EMAIL PROTECTED]> writes: > > > I'm trying to come up with an SQL statement that works under sqlite that can > > return a list of rows depending if a list of ids exist. For individual > > checking i'm using: > > > > select 1

[sqlite] Results even if no rows

2006-07-13 Thread andrew gatt
Hi all, I'm trying to come up with an SQL statement that works under sqlite that can return a list of rows depending if a list of ids exist. For individual checking i'm using: select 1 from table where id == 1; which returns a 1 if there is a row or no rows if it doesn't exist. However i have

Re: [sqlite] Count and Display

2006-06-22 Thread andrew gatt
qlite-users@sqlite.org> Sent: Thursday, June 22, 2006 5:42 PM Subject: Re: [sqlite] Count and Display > andrew gatt wrote: > > I'm trying to work out the most efficient way of performing a query. > > What i want is for the rest of the database starting at a certain letter, an

[sqlite] Count and Display

2006-06-22 Thread andrew gatt
I'm trying to work out the most efficient way of performing a query. What i want is for the rest of the database starting at a certain letter, and ordered alphabetically. So for example this command: SELECT name FROM people WHERE name > 'C%' ORDER BY people however i need to apply a limit and

RE: [sqlite] ATTACH, query and differentiate

2005-08-04 Thread Andrew Gatt
.org/lang_attach.html Donald Griggs Opinions are not necessarily those of Misys Healthcare Systems nor its board of directors. -----Original Message- From: Andrew Gatt [mailto:[EMAIL PROTECTED] Sent: Thursday, August 04, 2005 6:56 AM To: sqlite-users@sqlite.org Subject: [sqlite] ATTACH, query and differentiate

[sqlite] ATTACH, query and differentiate

2005-08-04 Thread Andrew Gatt
Hi, I'm not sure if what i am trying to acheive is possible, but if i explain what i'm trying to do someone may be able to point me in the right direction. I have a database table that holds some information, with each entry having a unique id. So when i query the database i can get a list of