By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,709 Members | 2,116 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,709 IT Pros & Developers. It's quick & easy.

Which querry will give more performance

P: 36
I have the following tables,

1> employee_master(emp_id int primary key, emp_name varchar(100));
2> employee_salary_payment(salary_rid int primary key, emp_id int, sal_date date, paid_amt int);

The tables, employee_master and employee_salary_payment have one to many relation.
I need to list the salary payment done for the employee having id = 10. Here I use two different querry to work.

Querry 1:
Expand|Select|Wrap|Line Numbers
  1. Select em.emp_id, em.emp_name, esp.sal_date, esp.paid_amt
  2. from employee_master em join employee_salary_payment esp
  3. on (em.emp_id = esp.emp_id and em.emp_id = 10);
Querry 2:
Expand|Select|Wrap|Line Numbers
  1. Select em.emp_id, em.emp_name, esp.sal_date, esp.paid_amt
  2. from employee_master em join employee_salary_payment esp
  3. on em.emp_id = esp.emp_id
  4. where em.emp_id = 10;
Question:
Both the querry will give the same performance?
If no, what is the reason?
Nov 19 '07 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.