refrenceing information thru seperate tables

2006-08-15 Thread Brian E Boothe

HI all ;
   i wanna be able to link tables bu either id or Customer , and i also 
want to have a seperate table for Software information on that Customer,
so in one table it would be Customer name :  and another table would be 
products, linked to product id,
  so when i do a Queru it shows both tables information and how they 
were linked together

table customers:
id
Customer name


   table Products
  Product id :

   arrrge i need assistancethanks


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Re: refrenceing information thru seperate tables

2006-08-15 Thread Visolve DB TEAM

Hello Brain.

Solution is simple

Create two table customer table and product table in the below format

Definition of the Customer table

cust_id
Customername
Customer address
--
--
- etc
Productid

We are not sure about ur exact business requirement  Simply we have given 
example here that  how to link both tables .To do this WE need  any one 
common key field to combine the tables .Here we have taken the key productid 
as common filed for both tables .


Definition of the product table
-
Product table
prodcutiod
productname

Now apply the below query to get result what you expect that we hope

SELECT a.cust_id,a.customername,a.customeraddress,b.productid,b.productname 
FROM customer a ,product b WHERE a.productid=b.productid .


Note :While you join  tables please specify any one condtion in WHEER clause 
to filter resultset otherwise join query returns all recordset from both 
tables

The above query has been written using inner join ,

This Query returns resultset  only the cutomers belongs to particular 
productid information in the cusstomer table.


We hope it is ok for you .

Thanks
Visolve DB Team.

- Original Message - 
From: Brian E Boothe [EMAIL PROTECTED]

To: mysql@lists.mysql.com
Sent: Tuesday, August 15, 2006 11:17 PM
Subject: refrenceing information thru seperate tables



HI all ;
   i wanna be able to link tables bu either id or Customer , and i also 
want to have a seperate table for Software information on that Customer,
so in one table it would be Customer name :  and another table would be 
products, linked to product id,
  so when i do a Queru it shows both tables information and how they were 
linked together

table customers:
idCustomer name

   table Products
  Product id :

   arrrge i need assistancethanks


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: 
http://lists.mysql.com/[EMAIL PROTECTED]





--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]