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.
|