Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 SUB QUERY HELP

Author  Topic 

desikankannan
Posting Yak Master

152 Posts

Posted - 2008-03-20 : 07:37:17
hI,
I HAVE CREATED QUERY I GOT OUTPOUT LIKE ,HEREWITH IAM SENDING MY QUERY PLEASE GUIDE ME

FLDCCODE FLDMEANING FLDCPOINT
A ACTIVE 30
B BRIDGE 30
C CARGO 30

BUT I NEED OUT POINT LIKE THIS

FLDCCODE FLDMEANING FLDCPOINT
A ACTIVE 30
B BRIDGE ""
C CARGO ""



SELECT FLDCCODE,FLDMEANING ,
(
SELECT DISTINCT FLDCPOINT FROM TBLPOLICYM TPM , TBLPOLTYPM TY
,TBLPOLASSIGN TP
WHERE TPM.FLDREFNO ='ITEM0001' AND TY.FILDTCODE = TP.FLDTCODE AND TY.FLDACTIVATE ='Y' )
AS FLPOINT

FROM TBLCOUPTYPM
WHERE FLDCCODE IN
(
SELECT A.FLDCCODE AS FLDCCODE FROM TBLPOLTYPM A, TBLPOLASSIGN B
WHERE A.FILDTCODE = B.FLDTCODE
AND FLDACTIVATE='Y'
AND B.FLDREFNO= 'ITEM0001'
)

Desikankannan

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2008-03-20 : 07:40:50
Where you want to show output? If it is for some kind of reporting application like Crystal Reports, you can easily write record level formula to handle this.

Harsh Athalye
India.
"The IMPOSSIBLE is often UNTRIED"
Go to Top of Page

ayamas
Aged Yak Warrior

552 Posts

Posted - 2008-03-20 : 08:48:25
Read this
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=99163
Go to Top of Page
   

- Advertisement -