Tutorial66.com
@Share Application Development Skill.



Tutorial is tutorial...66 is My Country Code Up to 10 Years EXP for Application Development Role in Thailand.
collapse

Tutorial Category



Topic: SQL Subqueries Tuning sub query for better performance  (Read 188 times)


My Development skill
Java JSP Servlet EJB
Spring Framework
Hibernate Framework
iReport Jasper Report
Apache CXF
PHP Codigniter
Oracle PLSQL
Unix Shell Script
SQL Subqueries Tuning sub query for better performance
« on: December 28, 2011, 06:34:03 AM »
SQL Subqueries  Tuning sub query for better performance


Use this query for better query performance:
use only single sub query for SQL WHERE clause
Code: [Select]
select prod_name from prod_table
where (price,qty)=(select max(price),max(qty) from prod_table);


Instead of this query:
Code: [Select]
select prod_name from prod_table
where price=(select max(price) from prod_table)
and qty=(select max(qty) from prod_table);





SimplePortal 2.3.3 © 2008-2010, SimplePortal