Wrox Home  
Search P2P Archive for: Go

  Return to Index  

sql_language thread: Joining 2 tables..


Message #1 by "Imran" <schiise@y...> on Tue, 27 Aug 2002 02:18:18
Can you show us an example of what you expect the output to look like based
on the data that you have below? I don't understand what you mean by "sum
the sales price", when each user only has one product. The sum of /what/??

Cheers
Ken

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From: "Imran" <schiise@y...>
Subject: [sql_language] Joining 2 tables..


: Greetings
: I two tables, name Customer and Product the following are the tables:
:
: Product:
:
: ProductID      UserID        Description
: 3030            Akem           Tyre
: 2323            Dexter         Seats
:
: Customer:
:
: UserID       TotalPrice       EmailAddress
: Dexter        500             dexter@c...
: akem          300
:
:
: I want to get the total sales prices and the description from the Customer
: and Product tables.
: Is it by joining two tables as in the following way:
:
:
: select product.userid,customer.userid, sum(totalprice) as salesprice,
: Product.description
: FROM product,Customer
: where product.userid=customer.userid
:
: is it possible? thanks



  Return to Index