|
 |
asp_web_howto thread: Help need on query
Message #1 by "Ryan vd Merwe" <ryan@8...> on Thu, 31 Oct 2002 11:19:09 +0200
|
|
Hi
My problem is as follows:
I need to display the articles that are not listed in table 2. so for example how do I display the articles that are not in table 2
where nsID=1 (how do i display articles 1 and 4)?
hope this makes sense
Table structure is below.
table 1
Table1
articleID number
articleTitle text
represented table 1 looks like
Table1
articleID articleTitle
1 Product launch
2 Latest sales fuigures
3 Annual Report
4 Year end function
table 2
Table2
articleID number
nsID number
represented table 2 looks like:
Table2
articleID nsID
2 1
3 1
4 2
2 2
thanks in advance
Ryan vd Merwe
Message #2 by "Joe Ingle" <joe@k...> on Thu, 31 Oct 2002 10:02:59 -0000
|
|
Hi Ryan
You need to use a LEFT OUTER JOIN:
SELECT
Table1.articleID,
Table1.articleTitle,
Table2.nsID
FROM Table1
LEFT OUTER JOIN Table2 ON Table1.articleID =3D Table2.articleID
-----Original Message-----
From: Ryan vd Merwe [mailto:ryan@8...]
Sent: Thursday, October 31, 2002 9:19 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Help need on query
Hi
My problem is as follows:
I need to display the articles that are not listed in table 2. so for
example how do I display the articles that are not in table 2 where
nsID=3D1 (how do i display articles 1 and 4)?
hope this makes sense
Table structure is below.
table 1
Table1
articleID number
articleTitle text
represented table 1 looks like
Table1
articleID articleTitle
1 Product launch
2 Latest sales fuigures
3 Annual Report
4 Year end function
table 2
Table2
articleID number
nsID number
represented table 2 looks like:
Table2
articleID nsID
2 1
3 1
4 2
2 2
thanks in advance
Ryan vd Merwe
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=3Dnosim/theprogramm
e
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=3Dnosim/theprogramm
e
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=3Dnosim/theprogramm
e
r-20
Message #3 by "Ryan vd Merwe" <ryan@8...> on Thu, 31 Oct 2002 14:15:42 +0200
|
|
Hi Joe
I have tried left outer join but it just displays all the listings in
table1.
----- Original Message -----
From: "Joe Ingle" <joe@k...>
To: "ASP Web HowTo" <asp_web_howto@p...>
Sent: Thursday, October 31, 2002 12:02 PM
Subject: [asp_web_howto] RE: Help need on query
Hi Ryan
You need to use a LEFT OUTER JOIN:
SELECT
Table1.articleID,
Table1.articleTitle,
Table2.nsID
FROM Table1
LEFT OUTER JOIN Table2 ON Table1.articleID = Table2.articleID
-----Original Message-----
From: Ryan vd Merwe [mailto:ryan@8...]
Sent: Thursday, October 31, 2002 9:19 AM
To: ASP Web HowTo
Subject: [asp_web_howto] Help need on query
Hi
My problem is as follows:
I need to display the articles that are not listed in table 2. so for
example how do I display the articles that are not in table 2 where nsID=1
(how do i display articles 1 and 4)?
hope this makes sense
Table structure is below.
table 1
Table1
articleID number
articleTitle text
represented table 1 looks like
Table1
articleID articleTitle
1 Product launch
2 Latest sales fuigures
3 Annual Report
4 Year end function
table 2
Table2
articleID number
nsID number
represented table 2 looks like:
Table2
articleID nsID
2 1
3 1
4 2
2 2
thanks in advance
Ryan vd Merwe
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
---
Improve your web design skills with these new books from Glasshaus.
Usable Web Menus
http://www.amazon.com/exec/obidos/ASIN/1904151027/ref=nosim/theprogramme
r-20
Constructing Accessible Web Sites
http://www.amazon.com/exec/obidos/ASIN/1904151000/ref=nosim/theprogramme
r-20
Practical JavaScript for the Usable Web
http://www.amazon.com/exec/obidos/ASIN/1904151051/ref=nosim/theprogramme
r-20
|
|
 |