Skip site navigation (1) Skip section navigation (2)

[ocpfree] Query Optimization Help Needed.

From: vaibhav singh <vaibhav19solo(at)yahoo(dot)com>
To: boson_oracle_dba(at)groups(dot)yahoo(dot)com, ocpfree(at)groups(dot)yahoo(dot)com,ocpfree2(at)groups(dot)yahoo(dot)com, oracle-metalink(at)groups(dot)yahoo(dot)com,oracledevelopment(at)groups(dot)yahoo(dot)com
Cc: Cert_OCP_Kangs(at)groups(dot)yahoo(dot)com, oca_dev(at)groups(dot)yahoo(dot)com,OCP-developertrack(at)groups(dot)yahoo(dot)com, OCP9i-DBA(at)groups(dot)yahoo(dot)com,ocp_dba_9i(at)groups(dot)yahoo(dot)com, OCP_Study(at)groups(dot)yahoo(dot)com,ocpfree2003(at)groups(dot)yahoo(dot)com, oracledevelopers(at)groups(dot)yahoo(dot)com
Subject: [ocpfree] Query Optimization Help Needed.
Date: 2004-07-13 11:40:20
Message-ID: 20040713114020.61706.qmail@web52906.mail.yahoo.com (view raw or flat)
Thread:
Lists: pgsql-sql
Hi all,

I need ur help regarding the optimization of following
query. If possible pls reply asap.
Thankz a ton in advance.


 
SELECT company_name,coupon_id,coupon_title, city_name,
category_name, NVL(person_name,' ') person_name,
NVL (locality_name,' ') locality_name,
NVL(company_address,' ') company_address,
NVL(mobile_no,' ') mob,
NVL(company_phone1,' ') ph1,
NVL(company_phone2,' ') ph2,
psid_1,discount1,
NVL(psid_2,-1) p2,
NVL(discount2,-1) d2,
NVL(psid_3,-1) p3,
NVL(discount3,-1) d3,
TO_CHAR(expiry_date,'dd-mm-yyyy')expdate,
REDEMPTION_METHOD, PICTURE_FILE_NAME,
NVL(company_info,' ') company_info

FROM TBL_MCP_COUPON a, TBL_MCP_LOCALITY, TBL_MCP_CITY,
TBL_MCP_CATEGORY
WHERE (verify='Y' OR verify='R')
AND ROWNUM <= 10 AND (SYSDATE <= EXPIRY_DATE) 
AND a.city_id=4
AND a.category_id=10
AND a.category_id=TBL_MCP_CATEGORY.category_id
AND a.locality_id=TBL_MCP_LOCALITY.locality_id
AND a.city_id=TBL_MCP_CITY.city_id
--check for with and without  following two lines ,
becouse these lines will be included in query
conditionally

--AND a.locality_id=25
--AND (psid_1=113 OR psid_2=113 OR psid_3=113) 

AND a.coupon_id NOT IN
( SELECT a.coupon_id FROM 
TBL_MCP_USERCOUPONS b,TBL_MCP_COUPON a
WHERE a.coupon_id=b.coupon_id AND a.REDEMPTION_METHOD
= 1 AND b.MIN= 1234567891)

ORDER BY LOWER(company_name);




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/o7folB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ocpfree/

<*> To unsubscribe from this group, send an email to:
    ocpfree-unsubscribe(at)yahoogroups(dot)com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 


pgsql-sql by date

Next:From: Bruno Wolff IIIDate: 2004-07-13 12:38:17
Subject: Re: [PHP] Secure DB Systems - How to
Previous:From: StuDate: 2004-07-13 10:54:44
Subject: Re: Sorting problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group