You are here: Subquery doesnt work!!!!!!!!!!! « MsSQL Server « IT news, forums, messages
Subquery doesnt work!!!!!!!!!!!

Posted by sanju on 09/28/33 11:59

Hi all, I am sanju,
To generate report I am using table named as "tempTest" for displaying
count of dealer.
On back end i am using oracle.
I am unable to insert the second qry
The datatype of the table is as follows

select * from tempTest
CREATE table tempTest
( DEALER_NAME varchar2(50),
DEALER_CODE varchar2(50),
DEALER_DATA INT,
MAIL_OUT varchar2(50)
)

--drop table tempTest;
------------------- /* Dealer Wise All Date [TO INSERT
DEALER_NAME,DEALER_CODE,DEALER_DATA}*/
INSERT INTO TEMPTEST (DEALER_NAME,DEALER_CODE,DEALER_DATA)
select Dealer_name ,DM.DEALER_CODE,count(Dealer_name) from CUSTMAST
A, DEALER_MASTER DM , MAHINDRA_DET MD
where Complete_status ='C' and A.REJECTED IS NULL AND MD.MODEL_GROUP
IN ('BOLERO','SCORPIO')
AND A.SOURCE_INFORMATION IN ('JD POWER SALES')
AND A.CUST_CODE=MD.CUST_CODE AND A.DEALER_CODE=DM.DEALER_CODE AND
MD.PURCHASE_DT
BETWEEN '01-Jul-2006' AND '30-Sep-2006'
Group by Dealer_name,DM.DEALER_CODE
order by Dealer_name

---- mail Out[TO UPDATE MAIL_OUT COLUNM]
UPDATE tempTest SET MIGRATED= Dealer_name ,count(Dealer_name) FROM
CUSTMAST A
INNER JOIN MAHINDRA_DET B ON A.CUST_CODE = B.CUST_CODE
INNER JOIN DEALER_MASTER DM ON A.DEALER_CODE=DM.DEALER_CODE
INNER JOIN SALES_TELECALLING_RESPONSE C ON A.CUST_CODE=C.CUST_CODE
WHERE B.MODEL_GROUP IN ('SCORPIO','BOLERO')
AND A.REJECTED IS NULL
AND (B.PURCHASE_DT BETWEEN '01-Jul-2006' AND '30-Sep-2006')
AND C.RESPONSE IN ('Y')
GROUP BY Dealer_name
----- NOT WORKING

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация