Re: [sqlite] Multiple SELECTs in one call

2019-02-07 Thread Jose Isaias Cabrera
Slavin Sent: Wednesday, February 6, 2019 11:30 PM To: SQLite mailing list Subject: Re: [sqlite] Multiple SELECTs in one call On 7 Feb 2019, at 4:21am, Jose Isaias Cabrera wrote: > want to use the result of (SELECT a from t where e != 1); to run another > select (SELECT a from t where

Re: [sqlite] Multiple SELECTs in one call

2019-02-07 Thread Jose Isaias Cabrera
Thanks, Keith. Yep, exactly what I was looking for. Gracias. From: sqlite-users on behalf of Keith Medcalf Sent: Wednesday, February 6, 2019 11:37 PM To: SQLite mailing list Subject: Re: [sqlite] Multiple SELECTs in one call You mean something like select

Re: [sqlite] Multiple SELECTs in one call

2019-02-06 Thread Keith Medcalf
qlite.org >Subject: [sqlite] Multiple SELECTs in one call > > >Greetings. > >I need some help from you gurus to have multiple selects, but the >sequence is important. For example, > >create table t (a, b, c, d, e); >insert into t values (1,2,3,4,5); >insert into t va

Re: [sqlite] Multiple SELECTs in one call

2019-02-06 Thread Simon Slavin
On 7 Feb 2019, at 4:21am, Jose Isaias Cabrera wrote: > want to use the result of (SELECT a from t where e != 1); to run another > select (SELECT a from t where d > 3); and then, one more select (SELECT a > from t where c != 1 AND b != 1); How are these related to each other ? Do you want

[sqlite] Multiple SELECTs in one call

2019-02-06 Thread Jose Isaias Cabrera
Greetings. I need some help from you gurus to have multiple selects, but the sequence is important. For example, create table t (a, b, c, d, e); insert into t values (1,2,3,4,5); insert into t values (2,2,3,4,5); insert into t values (3,3,3,3,3); insert into t values (4,1,1,1,1); insert into

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 ids, i want to select multiple rows >> at a

Re: [sqlite] Multiple Selects

2008-10-19 Thread MikeW
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 ids, i want to select multiple rows > at a time. At present i am

Re: [sqlite] Multiple Selects

2008-10-18 Thread Igor Tandetnik
"Andrew Gatt" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > I'm guessing my SQL is the worst way of doing things so i've been > trying to find a better method. I stumbled across "SELECT name FROM > table WHERE id IN (x,y,z) however this doesn't allow me to specify > the order the

Re: [sqlite] Multiple Selects

2008-10-18 Thread Jonas Sandman
If it's completely arbitrary I think you are stuck with using union unless it's an order that you might know beforehand. Then you can add an extra column with the index. /Jonas On Sat, Oct 18, 2008 at 7:05 PM, Andrew Gatt <[EMAIL PROTECTED]> wrote: > Jonas Sandman wrote: >> Just to point out the

Re: [sqlite] Multiple Selects

2008-10-18 Thread Jonas Sandman
Just to point out the obvious, have you tried ORDER BY? "SELECT name FROM table ORDER BY name;" will return your list in alphabetical order. /Jonas On Sat, Oct 18, 2008 at 6:53 PM, Andrew Gatt <[EMAIL PROTECTED]> wrote: > Andrew Gatt wrote: >> I'm not sure if i'm missing something, but is there

Re: [sqlite] multiple selects in a single prepare

2006-12-29 Thread drh
"Igor Tandetnik" <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > SELECT count(state='Normal'), count(state='Critical') FROM tbl1; > > Wouldn't that just return the number of all rows in tbl1, twice? That > probably should be > > SELECT sum(state='Normal'), sum(state='Critical') FROM

Re: [sqlite] multiple selects in a single prepare

2006-12-29 Thread drh
chetana bhargav <[EMAIL PROTECTED]> wrote: > Actually I am trying to retrieve values in a single step. > > My queries need to be something like, > > select count(*) from tbl1 where state='Normal'; > select count(*) from tbl1 where state='Critical' > > I got to have these two as seperate,

[sqlite] multiple selects in a single prepare

2006-12-27 Thread chetana bhargav
Hi, Just wanted to know can we have multiple quries in a single prepare statement seperated by semicolons.Something like, Select count(*) from tbl where name="foo";select count(*) from tbl1 where name = "bar" ... Chetana. __ Do You Yahoo!?

Re: [sqlite] Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-11 Thread RohitPatel9999
Many thanks for helping. While using SQLite dll Version 3.3.4 on Windows - Multiple threads/processes access SQLite database, - Each thread does some SELECTs, INSERTs or UPDATEs. If for some single SELECT (where user input is used in SQL statement, so to avoid SQL injection),

Re: [sqlite] Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-09 Thread John Stanton
It depends upon your application. For it to function optimally you should make each transaction on your application an SQL transaction, commit it on success or rollback if there is a problem. In that way you make each transaction atomic and maintain the integrity of your database. Since

Re: [sqlite] Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-09 Thread RohitPatel9999
Thanks for clearing doubt. Now question is... While using SQLite dll Version 3.3.4 on Windows - Multiple threads/processes access SQLite database, - Each thread does some SELECTs, INSERTs or UPDATEs. Wrapping all read-only SELECEs with BEGIN TRANSACTION and using BEGIN EXCLUSIVE to wrap

[sqlite] Multiple SELECTs (and single SELECT) and TRANSACTION ?

2006-08-08 Thread RohitPatel9999
Hi All, While using SQLite dll Version 3.3.4 on Windows - Multiple threads/processes access SQLite database, - Each thread does some SELECTs, INSERTs or UPDATEs. Scenario 1 If action of some user needs to execute multiple SELECT statements (read-only, no plan to write), it needs to start