I don't know you table structure but something like this would do it...
SELECT * from QB as tbl1
JOIN relAB as tbl2
ON tbl2.A=tbl1.A
where tbl2.a='a1'
Butch Bean
-Original Message-
From: Egor Egorov [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 09, 2002 7:24 AM
To: [EMAIL
'
SELECT * from QB as tbl1
LEFT JOIN relAB as tbl2
ON tbl2.B=tbl1.ref
where tbl2.B='a1'
-Original Message-
From: Nuno Teixeira [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 09, 2002 11:18 AM
To: Butch Bean
Cc: [EMAIL PROTECTED]
Subject: Re: is possible 1 query with 2
Hi,
I try it and I get a syntax error:
You have an error in your SQL syntax near 'on tbl2.A=tbl1.A where
tbl2.A='a1'' at line 1
My tables structure are:
show fields from QB;
+--+-+--+-+-++
| Field| Type|
Bean
| Cc: [EMAIL PROTECTED]
| Subject: Re: is possible 1 query with 2 selects?
|
|
|
| Hi,
|
| I try it and I get a syntax error:
|
| You have an error in your SQL syntax near 'on tbl2.A=tbl1.A where
| tbl2.A='a1'' at line 1
|
| My tables structure are:
|
| show fields from QB
PROTECTED]
| Subject: Re: is possible 1 query with 2 selects?
|
|
|
| Hi,
|
| I try it and I get a syntax error:
|
| You have an error in your SQL syntax near 'on tbl2.A=tbl1.A where
| tbl2.A='a1'' at line 1
|
| My tables structure are:
|
| show fields from QB
Hello Nuno,
I'm trying to make a query with only one command but I can't see how to do
it.
Supose that are 2 tables like:
table QA table QB
ref text ref text
--- ---
a1 texta1 b1 textb1
a2 texta2 b2 textb2
a3 texta3 b3 textb3
and there is a table that
as tbl2
| | ON tbl2.B=tbl1.ref
| | where tbl2.A='a1'
|
| -Original Message-
| From: Nuno Teixeira [mailto:[EMAIL PROTECTED]]
| Sent: Saturday, February 09, 2002 12:45 PM
| To: Butch Bean
| Cc: [EMAIL PROTECTED]
| Subject: Re: is possible 1 query with 2 selects?
|
|
|
| Hi
Try
select * from QB, relAB where QB.ref = relAB.B and relAB.A='a1';
- Original Message -
From: Egor Egorov [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, February 09, 2002 4:24 AM
Subject: is possible 1 query with 2 selects?
Nuno,
Friday, February 08, 2002, 11:04:51 PM,
On Tue, Feb 12, 2002 at 01:31:43PM -, DL Neil wrote:
| Hello Nuno,
|
|I'm trying to make a query with only one command but I can't see how to do
|it.
|
|Supose that are 2 tables like:
|
|table QA table QB
|ref text ref text
|--- ---
|a1 texta1 b1
as tbl2
| | ON tbl2.B=tbl1.ref
| | where tbl2.A='a1'
|
| -Original Message-
| From: Nuno Teixeira [mailto:[EMAIL PROTECTED]]
| Sent: Saturday, February 09, 2002 12:45 PM
| To: Butch Bean
| Cc: [EMAIL PROTECTED]
| Subject: Re: is possible 1 query with 2 selects?
|
|
|
| Hi
I don't know you table structure but something like this would do it...
SELECT * from QB as tbl1
JOIN relAB as tbl2
ON tbl2.A=tbl1.A
where tbl2.a='a1'
Butch Bean
-Original Message-
From: Egor Egorov [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 09, 2002 7:24 AM
To: [EMAIL
Hi,
I try it and I get a syntax error:
You have an error in your SQL syntax near 'on tbl2.A=tbl1.A where
tbl2.A='a1'' at line 1
My tables structure are:
show fields from QB;
+--+-+--+-+-++
| Field| Type|
'
SELECT * from QB as tbl1
LEFT JOIN relAB as tbl2
ON tbl2.B=tbl1.ref
where tbl2.B='a1'
-Original Message-
From: Nuno Teixeira [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 09, 2002 11:18 AM
To: Butch Bean
Cc: [EMAIL PROTECTED]
Subject: Re: is possible 1 query with 2
Bean
| Cc: [EMAIL PROTECTED]
| Subject: Re: is possible 1 query with 2 selects?
|
|
|
| Hi,
|
| I try it and I get a syntax error:
|
| You have an error in your SQL syntax near 'on tbl2.A=tbl1.A where
| tbl2.A='a1'' at line 1
|
| My tables structure are:
|
| show fields from QB
PROTECTED]
| Subject: Re: is possible 1 query with 2 selects?
|
|
|
| Hi,
|
| I try it and I get a syntax error:
|
| You have an error in your SQL syntax near 'on tbl2.A=tbl1.A where
| tbl2.A='a1'' at line 1
|
| My tables structure are:
|
| show fields from QB
15 matches
Mail list logo