Wrox Programmer Forums
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 19th, 2005, 05:42 PM
Authorized User
 
Join Date: Jun 2003
Posts: 71
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to rylemer Send a message via MSN to rylemer Send a message via Yahoo to rylemer
Default SQL Statement


tbl_1
-------------------------
ProductID | Product
-------------------------
PH1 | Mouse
PH2 | KeyBoard
PH3 | Monitor
PH4 | CPU
PH5 | Headset

tbl_2
--------------------------
ProductID | Product
--------------------------
PH1 | Mouse
PH2 | KeyBoard
PH3 | Monitor
PH6 | CDROM
PH7 | Video Card


SELECT tbl_1.ProductID, tbl_1.Product
FROM tbl_1 INNER JOIN tbl_2 ON tbl_1.ProductID=tbl_2.ProductID;

---------------------
ProductID | Product
---------------------
PH1 | Mouse
PH2 | KeyBoard
PH3 | Monitor



 
Old October 21st, 2005, 02:05 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

So what is your question?

 
Old October 21st, 2005, 03:01 PM
Authorized User
 
Join Date: Sep 2005
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What do you need?
Left Join? Full Outer Join???

“I sense many useless updates in you... Useless updates lead to defragmentation... Defragmentation leads to downtime...Downtime leads to suffering..Defragmentation is the path to the darkside.. DBCC INDEXDEFRAG and DBCC DBREINDEX are the force...May the force be with you" -- http://sqlservercode.blogspot.com/
 
Old October 21st, 2005, 09:07 PM
Friend of Wrox
 
Join Date: Aug 2004
Posts: 385
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Answer is:

Yes those are two tables and a select statement.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with SQL Statement forumsUID SQL Server 2000 1 August 23rd, 2007 08:08 AM
convert a SQL Statement from MS Access to a SQL Corey Access 6 March 28th, 2007 12:33 PM
SQL Statement??? carswelljr SQL Server 2000 2 August 25th, 2006 12:40 PM
Sql Statement help morpheus Classic ASP Basics 0 March 9th, 2004 10:55 AM
sql statement chrisangus@btinternet.com Beginning VB 6 2 June 23rd, 2003 04:28 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.