Forum Moderators: open

Message Too Old, No Replies

Please help me to form a query

         

hemanth_ap

7:13 am on Aug 7, 2006 (gmt 0)

10+ Year Member



I have 3 tables having folling fields
Valid_sellers : SELLER_ID, NAME, ATTR_CHANGED

Seller_Tags : SELLER_ID, product_id, URL, last_import_date, INACTIVE, sum(MERCHANT_WEIGHT), sum(SHIPPING_COST_GROUND)

Cost_rules : OWNER_ID, COMMENTs

I want a query to list for all fields from selelr_tags and COMMENTS for all sellers in Valid_sellers with ATTR_CHANGED >sysdate-1

syber

1:12 pm on Aug 7, 2006 (gmt 0)

10+ Year Member



I don't see how you are going to bring in the Cost_rules table as OWNER_ID doesn't match up to any column in the other tables. You will probably need to bring in a fourth table that has both OWNER_ID and SELLER_ID columns.

hemanth_ap

1:43 am on Aug 8, 2006 (gmt 0)

10+ Year Member



oh sorry!
The owner_id is same as Seller_id

syber

2:24 am on Aug 8, 2006 (gmt 0)

10+ Year Member




SELECT Seller_Tags.*, comments
FROM Seller_Tags JOIN Valid_sellers
ON Seller_Tags.SELLER_ID = Valid_sellers.SELLER_ID
JOIN Cost_rules
ON Valid_sellers.SELLER_ID = Cost_rules.OWNER_ID
WHERE ATTR_CHANGED > sysdate-1