Re: [sqlite] More on Referring to columns named with AS

2009-11-14 Thread P Kishor
On Sat, Nov 14, 2009 at 7:27 PM, Peter Haworth wrote: > After searching around the web, it seems I can't expect the SELECT > syntax in my earlier post to work but that repeating the aliased > column logic as part of the sum function will work so I tried that and > it does indeed total things up fo

Re: [sqlite] More on Referring to columns named with AS

2009-11-14 Thread Igor Tandetnik
Peter Haworth wrote: > But, it now only gives me one row in the result with columns from the > last selected record plus the a column for the sum function. What I > was hoping to get was all the individual rows that qualify in the > WHERE clause with a column containing the sum for all the selecte

[sqlite] More on Referring to columns named with AS

2009-11-14 Thread Peter Haworth
After searching around the web, it seems I can't expect the SELECT syntax in my earlier post to work but that repeating the aliased column logic as part of the sum function will work so I tried that and it does indeed total things up for me. But, it now only gives me one row in the result wi

Re: [sqlite] Help me please to optimize sql query

2009-11-14 Thread Simon Slavin
On 15 Nov 2009, at 12:08am, Igor Tandetnik wrote: > select wf1.wordForm > from wform wf1 join mgWordsRelations rel on (wf1.wordNorm = rel.id_norminrel) >join wform wf2 on (rel.id_norm = wf2.wordNorm) > where wf1.ancode = 'someAncode' and wf2.wordForm = 'someWord' > order by random() limit 1;

Re: [sqlite] Help me please to optimize sql query

2009-11-14 Thread Igor Tandetnik
Unabashed wrote: > I need to execute query > SELECT wordForm FROM Lang.wform WHERE (ancode='someAncode') AND (wordNorm IN > (SELECT DISTINCT id_norminrel FROM mgWordsRelations WHERE id_norm IN (SELECT > wordNorm FROM Lang.wform WHERE wordForm='someWord'))) ORDER BY RANDOM() > LIMIT 1 Try this: se

Re: [sqlite] german documentation

2009-11-14 Thread Artur Reilin
Hi, i changed the text to an newer version. Is this one better? http://sqlite.yuedream.de/Allgemein,Besonderheiten.html If you see something other strange. let me please know it, that i can change that to. with best wishes Artur Reilin >> Hi, >> that's bad if i sound like an google translator

Re: [sqlite] german documentation

2009-11-14 Thread Marcus Grimm
> Hi, > that's bad if i sound like an google translator. At the beginning i tried > to translate it as original as i could, now i translate it, ho wit sounds > good to me. Can you say me, which sites are bad translated? For example the chapter: Vorgeschlagene Benutzungsarten für SQLite this one i

[sqlite] Help me please to optimize sql query

2009-11-14 Thread Unabashed
Hello! Nabble is really wonderful resource, because I received answers to all my questions. Sorry now, but I have to ask to help me again (if someone could). I'm not good in sql yet, so if anyone could find a minute to think about optimization of my sql query I'll be very much obliged. I have two

Re: [sqlite] Referring to columns named with AS

2009-11-14 Thread Kees Nuyt
On Sat, 14 Nov 2009 21:45:09 +0100, Kees Nuyt wrote: > [-- sql with errors snipped --] Make that: SELECT 'detail' AS Descr, CASE WHEN THEN ELSE END AS CalcA FROM yourtable UNION SELECT 'total' AS Descr sum( CASE

Re: [sqlite] german documentation

2009-11-14 Thread Artur Reilin
> Hi, > > I mean a google like translator. > As I said, partly. not all of this. > I think you should not try to translate > word by word, preserving even the original english > sentence structure. The result sounds machine-like > for a native german. > But it is interesting as an exercise, if you

Re: [sqlite] german documentation

2009-11-14 Thread Marcus Grimm
Hi, I mean a google like translator. As I said, partly. not all of this. I think you should not try to translate word by word, preserving even the original english sentence structure. The result sounds machine-like for a native german. But it is interesting as an exercise, if you define it this wa

Re: [sqlite] german documentation

2009-11-14 Thread Artur Reilin
>> Hello, >> >> sorry for the double mail, but i cannot post to my old post. >> >> The german documentation is now on: >> >> http://sqlite.yuedream.de >> >> What do you think? Is the design good? > > this will be a lot of work and I'm wondering why > you do this ? > Despite beeing a german with a

Re: [sqlite] german documentation

2009-11-14 Thread Marcus Grimm
> Hello, > > sorry for the double mail, but i cannot post to my old post. > > The german documentation is now on: > > http://sqlite.yuedream.de > > What do you think? Is the design good? this will be a lot of work and I'm wondering why you do this ? Despite beeing a german with a rather poor engli

Re: [sqlite] Referring to columns named with AS

2009-11-14 Thread Kees Nuyt
On Sat, 14 Nov 2009 11:58:42 -0800, Peter Haworth wrote: >I'm trying to get a SELECT statement in the following general form to >work: > >SELECT CASE WHEN THEN ELSE >END AS CalcA, sum(CalcA) AS CalcATotal > >I get an error "no such column" referring to CalcA when used in the >sum f

Re: [sqlite] Referring to columns named with AS

2009-11-14 Thread P Kishor
On Sat, Nov 14, 2009 at 1:58 PM, Peter Haworth wrote: > I'm trying to get a SELECT statement in the following general form to work: > > SELECT CASE WHEN THEN ELSE  END AS > CalcA, sum(CalcA) AS CalcATotal > > I get an error "no such column" referring to CalcA when used in the sum > functio

[sqlite] Referring to columns named with AS

2009-11-14 Thread Peter Haworth
I'm trying to get a SELECT statement in the following general form to work: SELECT CASE WHEN THEN ELSE END AS CalcA, sum(CalcA) AS CalcATotal I get an error "no such column" referring to CalcA when used in the sum function. I'm trying to get total of all the values of CalcA ac

Re: [sqlite] BUG (?) foreign_keys=on/off within a transaction

2009-11-14 Thread D. Richard Hipp
On Nov 14, 2009, at 11:34 AM, Uwe Sander wrote: > Hi, > the documentation states that ALTER TABLE ... RENAME ops do not > update the > name of a referenced table if foreign_keys=off has been set > previously. This > is only true if no enclosing transaction exists, otherwise > foreign_keys=o

Re: [sqlite] BUG (?) foreign_keys=on/off within a transaction

2009-11-14 Thread Dan Kennedy
On Nov 14, 2009, at 11:34 PM, Uwe Sander wrote: > Hi, > the documentation states that ALTER TABLE ... RENAME ops do not > update the > name of a referenced table if foreign_keys=off has been set > previously. This > is only true if no enclosing transaction exists, otherwise > foreign_keys=o

[sqlite] german documentation

2009-11-14 Thread Artur Reilin
Hello, sorry for the double mail, but i cannot post to my old post. The german documentation is now on: http://sqlite.yuedream.de What do you think? Is the design good? with best wishes Artur Reilin - Artur Reilin sqlite.yuedream.de ___ sqlite

[sqlite] BUG (?) foreign_keys=on/off within a transaction

2009-11-14 Thread Uwe Sander
Hi, the documentation states that ALTER TABLE ... RENAME ops do not update the name of a referenced table if foreign_keys=off has been set previously. This is only true if no enclosing transaction exists, otherwise foreign_keys=off is ignored. Is this a bug or a misunderstnding on my side? Rega

Re: [sqlite] Disk activity on Linux

2009-11-14 Thread Paul E
Bret Patterson writes: > > We're seeing a lot more disk activity than expected on Linux when using > sqlite3. We've run this same series of test on windows and the disk IO is > much lower, which is the opposite of what I really expected. Below is > my scenario and perhaps someone can point out

Re: [sqlite] Bug candidate: virtual tables vs. external db connections

2009-11-14 Thread Grzegorz Wierzchowski
Thursday 12 of November 2009 06:09:40 Dan Kennedy napisał(a): > I don't think you can use sqlite3_result_value() with a value > that comes from a different database connection. At least not > currently. The xColumn() method of the patched echo-vtab does > that. > > Dan. That is right. I first trie