Hi,
I have two tables:
CREATE TABLE A (
ID integer primary key,
SERVER_ID integer
)
CREATE TABLE B (
ID integer primary key,
GROUP_ID integer,
SERVER_ID integer
)
The following SQL does not work, complaint is Error: no such column:
B.GROUP_ID
select ID,
(select SERVER_ID from A
On Thu, Nov 11, 2004 at 09:40:44AM -0500, [EMAIL PROTECTED] wrote:
[...] The following SQL does not work, complaint is Error: no such column:
B.GROUP_ID
select ID,
(select SERVER_ID from A where A.ID=B.GROUP_ID) as GROUP_ID
from B [...]
Looks like you haven't read this resource, yet:
Gerhard Haering wrote:
On Thu, Nov 11, 2004 at 09:40:44AM -0500, [EMAIL PROTECTED] wrote:
[...] The following SQL does not work, complaint is Error: no such column:
B.GROUP_ID
select ID,
(select SERVER_ID from A where A.ID=B.GROUP_ID) as GROUP_ID
from B [...]
Looks like you haven't
select ID,
(select SERVER_ID from A where A.ID=B.GROUP_ID) as GROUP_ID
from B [...]
It mentions, among others:
Variable subqueries
Subqueries must be static. They are evaluated only once. They
may not, therefore, refer to variables in the main query.
I'm not the
Brass Tilde wrote:
select ID,
(select SERVER_ID from A where A.ID=B.GROUP_ID) as GROUP_ID
from B [...]
It mentions, among others:
Variable subqueries
Subqueries must be static. They are evaluated only once. They
may not, therefore, refer to variables in the main
amead [EMAIL PROTECTED] writes:
Brass Tilde wrote:
select ID,
(select SERVER_ID from A where A.ID=B.GROUP_ID) as GROUP_ID
Hmm.. thanks but I'm still confused... isn't the above an example of a
non-static query that used variables from the main query?
If it uses variables from the main
Hi All,
I have a situation where populating data in a temp table takes a long time,
about 8 minutes, and I am wondering if anyone can offer any suggestions for
ways to speed it up.
I have the permanent table and associated index, shown below, which holds
tree structured component data. Each node
Hello,
I wonder is there better way to get table column/types information than
usage of EXPLAIN especially on empty table.
Michael
Return Receipt
Your [sqlite] Any better way to get info about table
document
:
Dennis Cote wrote:
Hi All,
I have a situation where populating data in a temp table takes a long time,
about 8 minutes, and I am wondering if anyone can offer any suggestions for
ways to speed it up.
I have the permanent table and associated index, shown below, which holds
tree structured
Thanks! Seems I completely missed some of the pragmas :(
-Original Message-
From: D. Richard Hipp [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 11, 2004 10:36 PM
To: [EMAIL PROTECTED]
Subject: Re: [sqlite] Any better way to get info about table
Michael Elfial wrote:
Hello,
I
Return Receipt
Your RE: [sqlite] Any better way to get info about table
document
:
Maybe I'm blind but I've looked and don't see the answer to this... what
is the format for the file to be imported using .import in the sqlite3
CLI database management tool?
-Alan
D. Richard Hipp wrote:
Dennis Cote wrote:
Hi All,
I have a situation where populating data in a temp table takes a
long time, about 8 minutes, and I am wondering if anyone can offer
any suggestions for ways to speed it up.
I have the permanent table and associated index, shown below, which
Is there some way to write this query in SQLite?
UPDATE
groups
SET
(fileCount, size) = (SELECT count(id), sum(size) FROM files where groupId =
15)
WHERE
groupId = 15;
Or must it be written like this?
UPDATE
groups
SET
fileCount = (SELECT count(id) FROM files where
Peter Bartholdsson wrote:
Is there some way to write this query in SQLite?
UPDATE
groups
SET
(fileCount, size) = (SELECT count(id), sum(size) FROM files where
groupId = 15)
WHERE
groupId = 15;
Sadly, no. SQLite only allows a subquery to return a single
value, not a tuple.
--
16 matches
Mail list logo