* Igor Tandetnik <[EMAIL PROTECTED]> [2006-12-29 17:35]:
> Why not
>
> select state, count(*)
> where state in ('Normal', 'Critical')
> group by state;
>
> ?
Clever!
* [EMAIL PROTECTED] <[EMAIL PROTECTED]> [2006-12-29 17:40]:
> SELECT count(state='Normal'), count(state='Critical') FROM tbl1;
[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 tbl1;
Igor Tandetnik
* chetana bhargav <[EMAIL PROTECTED]> [2006-12-29 17:20]:
> 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
ubject: [sqlite] Re: multiple selects in a single prepare
* chetana bhargav <[EMAIL PROTECTED]> [2006-12-28 06:00]:
> 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=&q
* chetana bhargav <[EMAIL PROTECTED]> [2006-12-28 06:00]:
> 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"
Just how is that
chetana bhargav
wrote:
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"
sqlite3_prepare will parse a single statement, and return a
6 matches
Mail list logo