473,406 Members | 2,387 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Difference between the querries.

I have two tables
1. AccountMaster(AccountID int, Name varchar(20))
2. Transactions(TransID, AccountID int, Amount float)

I have two queries for achieving the same result set. They are

Query1:
Select A.AccountID,A.Name,T.TransID,T.Amount
from AccountMaster A, Transactions T
where T. AccountID=A. AccountID

Query1:
Select A.AccountID,A.Name,T.TransID,T.Amount
from AccountMaster A
inner join Transactions T
on T. AccountID=A. AccountID

Here both will make use of inner join then,
Is there any difference in executing the queries ?
If yes, why SQL Server provides both the option ?
Mar 5 '07 #1
2 1667
I have two tables
1. AccountMaster(AccountID int, Name varchar(20))
2. Transactions(TransID, AccountID int, Amount float)

I have two queries for achieving the same result set. They are

Query1:
Select A.AccountID,A.Name,T.TransID,T.Amount
from AccountMaster A, Transactions T
where T. AccountID=A. AccountID

Query1:
Select A.AccountID,A.Name,T.TransID,T.Amount
from AccountMaster A
inner join Transactions T
on T. AccountID=A. AccountID

Here both will make use of inner join then,
Is there any difference in executing the queries ?
If yes, why SQL Server provides both the option ?
I am not sure but one uses a cross join, the best thing for you is to look up joins, also it is mainly to do with speed issues. In some cases it may actually be nessecary to use a inner join that a cross join can't do or doesn't allow.
Mar 5 '07 #2
hariharanmca
1,977 1GB
I have two tables
1. AccountMaster(AccountID int, Name varchar(20))
2. Transactions(TransID, AccountID int, Amount float)

I have two queries for achieving the same result set. They are

Query1:
Select A.AccountID,A.Name,T.TransID,T.Amount
from AccountMaster A, Transactions T
where T. AccountID=A. AccountID

Query1:
Select A.AccountID,A.Name,T.TransID,T.Amount
from AccountMaster A
inner join Transactions T
on T. AccountID=A. AccountID

Here both will make use of inner join then,
Is there any difference in executing the queries ?
If yes, why SQL Server provides both the option ?

Select A.AccountID,A.Name,T.TransID,T.Amount
from AccountMaster A, Transactions T
where T. AccountID=A. AccountID

this kind of qry may easy for join one or two tables with 1 or 2 fields, but if u go beyond that
you have to write many condition with combination in where clause
for join itself. some more conditions for selecting records after joining...
Mar 5 '07 #3

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

Similar topics

34
by: yensao | last post by:
Hi, I have a hard time to understand difference and similarities between Relational database model and the Object-Oriented model. Can somebody help me with this? Thank you in advance. ...
1
by: Richard Holliingsworth | last post by:
Hello: Thanks for reading this. We just converted to A2002 and some of my querries have stopped working and I can't figure out why. Basically, anything with a "NOT" is not working. For...
4
by: jamesyreid | last post by:
Hi, I'm really sorry to post this as I know it must have been asked countless times before, but I can't find an answer anywhere. Does anyone have a snippet of JavaScript code I could borrow...
3
by: bbawa1 | last post by:
Hi, I have a table which has a field ItemsReceived of type datetime. I have a grid view which has two columns. In first column i have to show the data from field ItemsReceived and in second...
3
by: Jacko7289 | last post by:
Hi, It's me again :-) Just wondering if its possible to create one report using the output of two or more SQL Querries. Currently i've got two SQL querries. one generates the total number of...
12
by: Petronius | last post by:
Hallo, does anyone have an idea how to implement difference lists in Javascript? Thanks allot in advance
5
by: Julius | last post by:
Hej dudes, I need to calc the difference between two timestamps / dates ... For example what i need to calculate: Date 1: 2007.11.06 - 20:13:04 Date 2: 2007.11.07 - 21:13:04 Difference:...
9
by: viki1967 | last post by:
Hi all! This new forum its great! :) Congratulations !!! My answer: why this my code not working? Nothing error but not work the difference.... : <html>
11
by: cmb3587 | last post by:
I have two arrays and I'm trying to create a 3rd array that is the difference between the two arrays Ex: arrayA: 3 5 8 9 arrayB: 3 4 6 9 difference of A-B: 5 8 however, my...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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,...
0
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.