Igor Tandetnik wrote...
On 1/23/2014 2:26 PM, St. B. wrote:
SELECT * FROM A WHERE projid in (SELECT projid FROM B WHERE ptask = 'a');
will probably fill the bill.
If I where to run your query, I would do a
select A.* from A inner join B on A.a = b.ProjId where b.ptask='a'
Careful - this
"Igor Tandetnik" wrote on Friday, January 24, 2014 9:48 AM...
On 1/24/2014 9:28 AM, jose isaias cabrera wrote:
Igor Tandetnik wrote...
On 1/23/2014 2:26 PM, St. B. wrote:
SELECT * FROM A WHERE projid in (SELECT projid FROM B WHERE ptask =
'a');
will probably fill the bill.
If I where to
St. B. wrote...
SELECT * FROM A WHERE projid in (SELECT projid FROM B WHERE ptask = 'a');
will probably fill the bill.
If I where to run your query, I would do a
select A.* from A inner join B on A.a = b.ProjId where b.ptask='a'
the join may optimize better than the in (select ...)
"Igor Tandetnik" wrote on Friday, January 24, 2014 9:48 AM...
On 1/24/2014 9:28 AM, jose isaias cabrera wrote:
Igor Tandetnik wrote...
On 1/23/2014 2:26 PM, St. B. wrote:
SELECT * FROM A WHERE projid in (SELECT projid FROM B WHERE ptask =
'a');
will probably fill the bill.
If I where to
On 1/24/2014 9:28 AM, jose isaias cabrera wrote:
Igor Tandetnik wrote...
On 1/23/2014 2:26 PM, St. B. wrote:
SELECT * FROM A WHERE projid in (SELECT projid FROM B WHERE ptask =
'a');
will probably fill the bill.
If I where to run your query, I would do a
select A.* from A inner join B on
Igor Tandetnik wrote...
On 1/23/2014 2:26 PM, St. B. wrote:
SELECT * FROM A WHERE projid in (SELECT projid FROM B WHERE ptask = 'a');
will probably fill the bill.
If I where to run your query, I would do a
select A.* from A inner join B on A.a = b.ProjId where b.ptask='a'
Careful - this
Use IN
Projid = (SELECT ...) takes only the first value returned from the subselect
-Ursprüngliche Nachricht-
Von: jose isaias cabrera [mailto:cabr...@wrc.xerox.com]
Gesendet: Donnerstag, 23. Jänner 2014 20:11
An: General Discussion of SQLite Database
Betreff: [sqlite] SELECTing from
On Thu, 23 Jan 2014 13:28:50 -0600
John McKown wrote:
> > SELECT * FROM A WHERE projid = (SELECT projid FROM B WHERE ptask =
> > 'a');
> >
> > This only returns one record (record 1) where it should return all
> > the records with ptask = 'a'.
>
> No, it is
On 1/23/2014 2:26 PM, St. B. wrote:
SELECT * FROM A WHERE projid in (SELECT projid FROM B WHERE ptask = 'a');
will probably fill the bill.
If I where to run your query, I would do a
select A.* from A inner join B on A.a = b.ProjId where b.ptask='a'
Careful - this will produce a different
St. B. wrote...
SELECT * FROM A WHERE projid in (SELECT projid FROM B WHERE ptask = 'a');
will probably fill the bill.
If I where to run your query, I would do a
select A.* from A inner join B on A.a = b.ProjId where b.ptask='a'
the join may optimize better than the in (select ...)
Thanks.
John McKown wrote...
On Thu, Jan 23, 2014 at 1:11 PM, jose isaias cabrera
wrote:
Greetings!
I have these tables A and B:
A
id,projid,a,b
1,1,'a','h'
2,2,'b','i'
3,3,'c','j'
4,4,'d','k'
5,5,'e','l'
...
...
B
id,projid,ptask
101,1,'a'
102,2,'b'
103,3,'a'
104,4,'b'
On Thu, Jan 23, 2014 at 1:11 PM, jose isaias cabrera
wrote:
>
> Greetings!
>
> I have these tables A and B:
> A
> id,projid,a,b
> 1,1,'a','h'
> 2,2,'b','i'
> 3,3,'c','j'
> 4,4,'d','k'
> 5,5,'e','l'
> ...
> ...
>
>
> B
> id,projid,ptask
> 101,1,'a'
> 102,2,'b'
> 103,3,'a'
>
On 1/23/2014 2:11 PM, jose isaias cabrera wrote:
SELECT * FROM A WHERE projid = (SELECT projid FROM B WHERE ptask = 'a');
You want
WHERE projid IN (SELECT ...)
IN operator accepts a set on the right; = operator only accepts a scalar
(which comes from the first row of the sub-select).
--
Igor Tandetnik wrote...
On 1/23/2014 2:11 PM, jose isaias cabrera wrote:
SELECT * FROM A WHERE projid = (SELECT projid FROM B WHERE ptask = 'a');
You want
WHERE projid IN (SELECT ...)
IN operator accepts a set on the right; = operator only accepts a scalar
(which comes from the first row
SELECT * FROM A WHERE projid in (SELECT projid FROM B WHERE ptask = 'a');
will probably fill the bill.
If I where to run your query, I would do a
select A.* from A inner join B on A.a = b.ProjId where b.ptask='a'
the join may optimize better than the in (select ...)
On Thu, Jan 23, 2014 at
Greetings!
I have these tables A and B:
A
id,projid,a,b
1,1,'a','h'
2,2,'b','i'
3,3,'c','j'
4,4,'d','k'
5,5,'e','l'
...
...
B
id,projid,ptask
101,1,'a'
102,2,'b'
103,3,'a'
104,4,'b'
105,5,'a'
...
...
When I do this SELECT,
SELECT * FROM A WHERE projid = (SELECT projid FROM B WHERE ptask =
16 matches
Mail list logo