473,786 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Which querry will give more performance

36 New Member
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
0 1280

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

Similar topics

2
3195
by: Eric Kincl | last post by:
Hello, I have an array of data in PHP. I would like to insert each member of the array into it's own row in SQL. The array is of variable length, so it would have to be dynamic code. How would I go about this? Would I stick the SQL querry generation and actual querry into a while loop? This would generate a lot of traffic between the SQL server and the PHP script. The arrays are each over 1000 members long, however, this is an rare...
0
1612
by: Costa Lino | last post by:
Hi All, I have a DataSet with xml file and I want to make a querry like this DataView dv = new DataView(mytable); dv.RowFilter = " Impression < ( MaxImpressions) "; Impression et MaxImpressions is collumns in my table the same querry access database is working but her is return 0
3
354
by: Linn K B | last post by:
I have a querry that works, but it is incredeble slow, so do anyone have any suggestions how to make this better: The table looks like this Gab(ID (key), Gid, Pid, Status, .....), mening there can be serveral occurences of Gid in the table. What i want is: Everyone with staus F2
5
1849
by: Clownfish | last post by:
OK, I'm having a brain freeze. I have a table like this: Office Name Phone ---------------------------------- SG Larry 555-1212 SG Moe 553-4444 SG Curly 666-8888 PO Ren 222-9999
1
1393
by: prileep | last post by:
I have two tables Users and UserLogin. Here i will use two methods of table design. and which query will return me the result more fast. The table size will be large that it may contain records in lakhs. Method 1: Tables: Users ( UserID varchar(20) primary key, PassWord varchar(20)) UsersLogin(UserID varchar(20),LoginDate DateTime) Query: Select Users.UserID,UsersLogin.LoginDate from Users U inner join UsersLogin UL
1
1503
by: nj2md | last post by:
Can some one assist with a querry. I need to know the code to querry a database to find the number of female and males that make over 50K a year and how to get capital gains and loses from the same database. Finally the code to count by occupation each country in the database. I Thanks in advance. I hope that this is enough data to assist with the code.
2
1465
by: dipalichavan82 | last post by:
i came across a article, where it was mentioned if we want a dynamic querry to fire then use parameterized querry e.g. string inputcity=textbox.text; SqlCommand cmd = new SqlCommand("select * from Customers where city= '" + inputCity + " ' "; Don't ever build a query this way! as this leads to hacking. instaed do it like this:
1
1550
by: iprogrammer | last post by:
i m new to .net and db connectivity in .net using sql server.... i want to insert values from into a db test1 from a function register(); where i will pass values the function register will this syntax work... public void register(int mc,int pt) { SqlConnection conn = new SqlConnection(@"Data Source=.\SQLEXPRESS;AttachDbFilename=C:\Inetpub\wwwroot\WebSite1\App_Data\test.mdf;Integrated Security=True;User...
2
1215
by: getmeidea | last post by:
I have the folowing two tables. employee_master( emp_rid int primary key identity, emp_no char(20) not null, emp_name varchar(100) ); salary_payment( sp_rid int primary key,
0
9655
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10363
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10110
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9964
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5398
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.