|
 |
asp_databases thread: ASP and SQL
Message #1 by "Elizabeta Siljanovski" <elizabetas@m...> on Thu, 29 Nov 2001 23:05:07 -0500
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0017_01C1792A.4D48D290
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
I'm new in ASP so please bear with me.
I'm confused about the following:
normaly, if i want to run a query directly from an SQL+ view where I
need data from two tables I need to write something like this:
select table.field, table2.field from table, table2
where table.field = table2.field;
this works just fine.
In examples that I have seen with ASP code, you have to have left join
statement instead. Why is this and what am I missing here?
Thank you all,
Elizabeta
Message #2 by David Cameron <dcameron@i...> on Fri, 30 Nov 2001 15:14:57 +1100
|
|
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
------_=_NextPart_001_01C17955.931B3760
Content-Type: text/plain
The reason different join syntax is used is that the syntax you are using at
the moment is not ANSI compliant.
Equivalent syntax using ANSI compliant text:
select table.field, table2.field
from table
INNER JOIN table2 ON
table.field = table2.field
Just in case you were wondering, SQL is case insensitive, so INNER = inner
iNnEr.
regards
David Cameron
nOw.b2b
dcameron@i...
> -----Original Message-----
> From: Elizabeta Siljanovski [mailto:elizabetas@m...]
> Sent: Friday, 30 November 2001 2:05 PM
> To: ASP Databases
> Subject: [asp_databases] ASP and SQL
>
> I'm new in ASP so please bear with me.
> I'm confused about the following:
>
> normaly, if i want to run a query directly from an SQL+ view where I need
data from two tables I need to write something like this:
>
> select table.field, table2.field from table, table2
>
> where table.field = table2.field;
>
> this works just fine.
>
> In examples that I have seen with ASP code, you have to have left join
statement instead. Why is this and what am I missing here?
>
> Thank you all,
>
> Elizabeta
>
$subst('Email.Unsub')
> Read the future with ebooks at B&N
>
http://service.bfast.com/bfast/click?bfmid=2181&sourceid=38934667&categoryid
=rn_ebooks
Message #3 by "Ken Schaefer" <ken@a...> on Fri, 30 Nov 2001 16:59:18 +1100
|
|
Actually:
WHERE table1.ID = table2.ID
was in the ANSI standard (ANSI SQL 89 I think), but joins where moved to the
FROM clause in ANSI SQL 92, and the WHERE clause join is now deprecated.
That means it is still in the standard, but it's not the recommended way of
doing things.
That said, most databases would support the WHERE clause join because
there's so much legacy code around that uses such syntax...
Cheers
Ken
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "David Cameron" <dcameron@i...>
Subject: [asp_databases] RE: ASP and SQL
: The reason different join syntax is used is that the syntax you are using
at
: the moment is not ANSI compliant.
:
: Equivalent syntax using ANSI compliant text:
:
: select table.field, table2.field
: from table
: INNER JOIN table2 ON
: table.field = table2.field
:
: Just in case you were wondering, SQL is case insensitive, so INNER = inner
: iNnEr.
:
: regards
: David Cameron
: nOw.b2b
: dcameron@i...
:
: > -----Original Message-----
: > From: Elizabeta Siljanovski [mailto:elizabetas@m...]
: > Sent: Friday, 30 November 2001 2:05 PM
: > To: ASP Databases
: > Subject: [asp_databases] ASP and SQL
: >
: > I'm new in ASP so please bear with me.
: > I'm confused about the following:
: >
: > normaly, if i want to run a query directly from an SQL+ view where I
need
: data from two tables I need to write something like this:
: >
: > select table.field, table2.field from table, table2
: >
: > where table.field = table2.field;
: >
: > this works just fine.
: >
: > In examples that I have seen with ASP code, you have to have left join
: statement instead. Why is this and what am I missing here?
: >
: > Thank you all,
: >
: > Elizabeta
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Message #4 by "Elizabeta Siljanovski" <elizabetas@m...> on Fri, 30 Nov 2001 01:10:20 -0500
|
|
This is a multi-part message in MIME format.
------=_NextPart_000_0007_01C1793B.CAFCA1B0
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit
Ok,
Thanks
Elizabeta
-----Original Message-----
From: David Cameron [mailto:dcameron@i...]
Sent: Thursday, November 29, 2001 11:15 PM
To: ASP Databases
Subject: [asp_databases] RE: ASP and SQL
The reason different join syntax is used is that the syntax you are
using at the moment is not ANSI compliant.
Equivalent syntax using ANSI compliant text:
select table.field, table2.field
from table
INNER JOIN table2 ON
table.field = table2.field
Just in case you were wondering, SQL is case insensitive, so INNER
inner = iNnEr.
regards
David Cameron
nOw.b2b
dcameron@i...
> -----Original Message-----
> From: Elizabeta Siljanovski [mailto:elizabetas@m...]
> Sent: Friday, 30 November 2001 2:05 PM
> To: ASP Databases
> Subject: [asp_databases] ASP and SQL
>
> I'm new in ASP so please bear with me.
> I'm confused about the following:
>
> normaly, if i want to run a query directly from an SQL+ view where I
need data from two tables I need to write something like this:
>
> select table.field, table2.field from table, table2
>
> where table.field = table2.field;
>
> this works just fine.
>
> In examples that I have seen with ASP code, you have to have left join
statement instead. Why is this and what am I missing here?
>
> Thank you all,
>
> Elizabeta
>
> ---
dcameron@i...
$subst('Email.Unsub')
> Read the future with ebooks at B&N
> http://service.bfast.com/bfast/click?bfmid=2181
<http://service.bfast.com/bfast/click?bfmid=2181&sourceid=38934667&categ
oryid=rn_ebooks> &sourceid=38934667&categoryid=rn_ebooks
elizabetas@m...
$subst('Email.Unsub')
Read the future with ebooks at B&N
http://service.bfast.com/bfast/click?bfmid=2181&sourceid=38934667&catego
ryid=rn_ebooks
|
|
 |