SELECT *    					
FROM (SELECT A.*, rownum cnt 						  
		FROM (SELECT  						                  
				A.CUSTID,A.PAYCOUNT, A.MEMBERID,A.ACCREDITSTATUS,C.CUSTNAME, C.CONTNAME, C.CONTPHONECITYCODE,  						                  
				C.CONTPHONE, C.CONTMOBPHONE, C.CONTFAXCITYCODE, C.CONTFAX, C.CONTEMAIL,  						                  
				C.CUSTAREA AS AREANAME, C.CUSTADDR, C.ORGINDUSTRY AS ORGINDUSTRYNAME,  						                  
				E.DESCRIPTION AS CUSTSTATNAME, F.DESCRIPTION AS ATYPENAME,  						                  
				null AS FNAME, G.DESCRIPTION AS B2BVALIDFLAGNAME, A.VALIDFLAG  						          
				FROM Q_CUSTOMERS A, Q_CUSTINFO C,  						                  
					(SELECT * FROM F_A_DE WHERE DOMAINCD = 'CUSTOMERS_CUSTSTAT') E,  						                  
					(SELECT * FROM F_A_DE WHERE DOMAINCD = 'CUSTOMERS_ATYPE') F,  						                  
					(SELECT * FROM F_A_DE WHERE DOMAINCD = 'CUSTOMERS_B2BVALIDFLAG') G  						          
				WHERE  						                  
					A.CUSTID = C.CUSTID  						                  
					AND A.CUSTSTAT = E.CODE( + )                                                        						                  
					AND A.ATYPE = F.CODE( + )   						                  
					AND A.b2bValidFlag = G.CODE( + )  		 		 		    		    		       
					AND A.MEMBERID = ? 		                		 		 		 		 		 		 		 		 		 		 		 		 		 		 		 		 				
				ORDER BY A.CUSTID DESC) A      		
WHERE ROWNUM < ?)      	WHERE CNT > ?   	
---------------------------
SELECT *
FROM (
	SELECT A.*, rownum AS cnt
	FROM (
		SELECT A.CUSTID, A.PAYCOUNT, A.MEMBERID, A.ACCREDITSTATUS, C.CUSTNAME
			, C.CONTNAME, C.CONTPHONECITYCODE, C.CONTPHONE, C.CONTMOBPHONE, C.CONTFAXCITYCODE
			, C.CONTFAX, C.CONTEMAIL, C.CUSTAREA AS AREANAME, C.CUSTADDR, C.ORGINDUSTRY AS ORGINDUSTRYNAME
			, E.DESCRIPTION AS CUSTSTATNAME, F.DESCRIPTION AS ATYPENAME, NULL AS FNAME, G.DESCRIPTION AS B2BVALIDFLAGNAME, A.VALIDFLAG
		FROM Q_CUSTOMERS A, Q_CUSTINFO C, (
			SELECT *
			FROM F_A_DE
			WHERE DOMAINCD = 'CUSTOMERS_CUSTSTAT'
		) E, (
			SELECT *
			FROM F_A_DE
			WHERE DOMAINCD = 'CUSTOMERS_ATYPE'
		) F, (
			SELECT *
			FROM F_A_DE
			WHERE DOMAINCD = 'CUSTOMERS_B2BVALIDFLAG'
		) G
		WHERE A.CUSTID = C.CUSTID
			AND A.CUSTSTAT = E.CODE(+)
			AND A.ATYPE = F.CODE(+)
			AND A.b2bValidFlag = G.CODE(+)
			AND A.MEMBERID = ?
		ORDER BY A.CUSTID DESC
	) A
	WHERE ROWNUM < ?
)
WHERE CNT > ?
