Topics Topics Help/Instructions Help Edit Profile Profile Member List Register Paatha Gnyapakaalu - Archives from Old DB  
Search New Posts 1 | 2 | 8 Hours Search New Posts 1 | 3 | 7 Days Search Search Tree View Tree View Latest tweets Live Tweets   Hide Images

Rate this post by selecting a number. 1 is the worst and 5 is the best.

    (Worst)    1    2    3    4    5     (Best)

Author Message
Top of pagePrevious messageNext messageBottom of page Link to this message

Vizagyouth
Kurra Bewarse
Username: Vizagyouth

Post Number: 1823
Registered: 02-2005
Posted From: 79.97.56.152

Rating: N/A
Votes: 0

Posted on Monday, March 17, 2014 - 6:10 pm:   

SELECT (
SELECT st1.StoreName
FROM dim.Store st1
,mart.TradeToSale mt1
WHERE mt1.CurrentStoreKey = st1.ParentStoreKey
) AS ParentName
,(
SELECT st.StoreName
FROM dim.Store st
,mart.TradeToSale mt
WHERE mt.CurrentStoreKey = st.StoreKey
) AS companyName
FROM mart.TradeToSale mar
,dim.Store store
WHERE CONVERT(DATE, mar.TradeDate) IN (
'2014-01-01'
,'2014-01-10'
);

First two select lo vunna subqueries only 1 record retrieve cheyali and that should be the column names in dim.store and mart.tradetosale
I have recently learnt a great tummy exercise.

Topics | Last Hour | Last Day | Last Week | Tree View | Search | Help/Instructions | Program Credits Administration