i have the following query
SELECT C.FIELD6 ,C.FIELD2,C.TRANSACTIONNO
FROM ipfroutine_deduction a,Servicemaster B,INPATIENTBILLALLDETAILS C,
Departments D,INPATIENTBILLS E
WHERE a.ipftestcd=b.code
AND C.BILLNO=E.BILLNO
and trim(a.ipftestname)=trim(b.childname)
AND TRIM(B.childname)=TRIM(C.FIELD2)
AND TRIM(A.IPFDEPTCD)=TRIM(C.DEPTCD)
AND TRIM(C.DEPTDESCR)=TRIM(D.NAME)
AND E.FROMDATE BETWEEN TRUNC(A.IPFFROMDATE) AND NVL(TRUNC(A.IPFTODATE),E.FROMDATE)
AND C.BILLNO = 'D00024585'

It's result as
NO FIELD6 FIELD2 TRANSACTINO
1 220 CHG (HB TC DC, PLT ETC) T08581764
2 220 CHG (HB TC DC, PLT ETC) T08582937
3 220 CHG (HB TC DC, PLT ETC) T08584394
4 120 CREATININE T08581761
5 120 CREATININE T08582934
6 120 CREATININE T08584392
7 120 CREATININE T08583900
8 100 URINE ROUTINE T08581766

IN THIS RESULT I REQUIRE ONLLY 1 NO ROW AND I WANT TO SKIP ROW NO 2,3.
I DON'T KNOW THE FUNCTION THAT TWO COLOUMN HAVE THE SAME VALUE AND THIRD ONE ARE DIFFRENT.
SO ANYBODY CAN GIVE ME SOLUTION
IT'S URGENT!

Recommended Answers

All 2 Replies

Try to use UNIQUE for field6

Try to use UNIQUE for field6

Acutally I am just selecting the query to retriew the values. first and second coloms have the same value but third one are diffrents value. So there are three rows. But I want only first row and want to skip other two rows.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.