If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > Find out Product Sold

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-14-10, 10:56
savy savy is offline
Registered User
 
Join Date: Nov 2010
Posts: 1
Find out Product Sold

Hi all,
I have a query regarding a table structure.We are using single SQL SERVER 2008 Database for two online selling websites.i.e.,The products which the two websites uses are same,but the description about the products are different.For example,we will sell a "Toy" of same price and model on both websites but with different description.At present I used two different id for websites say,Id "1" for Website 1 and Id as "2" for website 2.And also populated the Product table with diiferent Id's for same product along with the description and website id.
Now the problem is I need to find out how many "Toy" has been sold out in both websites together.
Can any one help me out?Should I introduce a separate table structure to relate the Productid?
Reply With Quote
  #2 (permalink)  
Old 11-16-10, 05:36
aflorin27 aflorin27 is offline
Registered User
 
Join Date: Apr 2008
Location: Iasi, Romania
Posts: 317
SELECT SUM(Sales.Value)
FROM Sales s, Product p
WHERE s.product_id = p.product_id
AND p.product_name = 'Toy'
__________________
Florin Aparaschivei
Iasi, Romania
Reply With Quote
Reply

Tags
sql server 2008

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On