473,399 Members | 4,192 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,399 software developers and data experts.

error in running the join query

40
Hi!
i am facing a probleum while excuting the query having join operator
i am using sql server 6.0 and my query is

Select BABLU.COM_NAME,BABLU.INDNT,VEER.ADDRESS From BABLU Join VEER on BABLU.COM_NAME = VEER.COM_NAME
Feb 25 '08 #1
14 1402
radcaesar
759 Expert 512MB
What is the error u r getin ?
Feb 25 '08 #2
progvar
40
Hi
THIS IS THE ERROR " SYNTAX ERROR NEAR VEER"




What is the error u r getin ?
Feb 26 '08 #3
ck9663
2,878 Expert 2GB
Try specifying if you want an INNER, LEFT or RIGHT join...

-- CK
Feb 26 '08 #4
progvar
40
HI!
NO ONE EXECUTED CORRECTLY, EVERY JOIN WHETHER IT IS INNER JOIN ,LEFT OR RIGHT JOIN
PLEASE PROVIDE SOME HELP



Try specifying if you want an INNER, LEFT or RIGHT join...

-- CK
Feb 26 '08 #5
ck9663
2,878 Expert 2GB
Please provide more info.

Paste same sample rows (it does not have to be the actual data) here and the query what you have so far.

-- CK
Feb 26 '08 #6
progvar
40
Hi!
i have two tables customer and sales in both tables "cus_id " column name is common and i am using the query

SELECT CUSTOMER.FIRST_NAME,CUSTOMER.LAST_NAME,SALES.DATE FROM CUSTOMER LEFT OUTER JOIN SALES
ON CUSTOMER.CUS_ID = SALES.CUS_ID
i want to get all the rows from customer tables and some from sales which matched in both tables

with regareds
varinder



Please provide more info.

Paste same sample rows (it does not have to be the actual data) here and the query what you have so far.

-- CK
Feb 27 '08 #7
ck9663
2,878 Expert 2GB
What error are you getting?

-- CK
Feb 27 '08 #8
progvar
40
SYNTAX ERROR NEAR JOIN
BUT I AM NOT GETTING WHAT IS WRONG IN MY CODE



What error are you getting?

-- CK
Feb 27 '08 #9
deric
92
Have you tried using aliases?

SELECT C.FIRST_NAME,C.LAST_NAME,S.DATE FROM CUSTOMER C LEFT OUTER JOIN SALES S
ON C.CUS_ID = S.CUS_ID

And if you'd like to get only the rows that has the same CUS_ID from both tables then you might want to use INNER JOIN.
Feb 27 '08 #10
progvar
40
Hi
THIS QUERY IS ALSO SHOWING THE SAME ERROR
"INCORRECT SYNTAX NEAR LEFT"


Have you tried using aliases?

SELECT C.FIRST_NAME,C.LAST_NAME,S.DATE FROM CUSTOMER C LEFT OUTER JOIN SALES S
ON C.CUS_ID = S.CUS_ID

And if you'd like to get only the rows that has the same CUS_ID from both tables then you might want to use INNER JOIN.
Feb 27 '08 #11
ck9663
2,878 Expert 2GB
Where are you running this?

-- CK
Feb 27 '08 #12
progvar
40
Hi!
I AM RUNNING THIS QUERY IN SQL SERVER 6.0 QUERY ANALYZER


Where are you running this?

-- CK
Feb 27 '08 #13
ck9663
2,878 Expert 2GB
Hi!
I AM RUNNING THIS QUERY IN SQL SERVER 6.0 QUERY ANALYZER
The query seems to be correct...


Expand|Select|Wrap|Line Numbers
  1. SELECT C.FIRST_NAME,C.LAST_NAME,S.DATE 
  2. FROM CUSTOMER C 
  3. LEFT OUTER SALES S ON C.CUS_ID = S.CUS_ID
-- CK
Feb 27 '08 #14
deric
92
I don't know if SQL Server 6.0 can support Join statements.. I don't have version 6.0 here.

You may code it differently, like:

SELECT CUSTOMER.FIRST_NAME, CUSTOMER.LAST_NAME, SALES.DATE
FROM CUSTOMER, SALES
WHERE CUSTOMER.CUS_ID = SALES.CUS_ID

The difference of that query from the query with Join statement is that Join statement could retrieve data faster.
Feb 27 '08 #15

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

Similar topics

0
by: Jonas Gorauskas | last post by:
I am having this one problem on an app I am writing where it shows the following error on some error trapping that I did: Query failed: Error Number: 1064 Description: You have an error in...
3
by: Matias Silva | last post by:
Hi Everyone, I wrote a for loop to build several select statements that are combined with a UNION. When I execute one of the queries separately, it works, but when I execute the query with a UNION...
2
by: frbn | last post by:
hi all, we currently experience an original problem on a production server with a postgresql 7.1.3 ( a bit old, I know :\ ) We just want to know if somebody experienced this problem: the...
4
by: Gary | last post by:
Hi, I get this error " " when my web page run, what does it mean? Hope someone can help!!! Gary
1
by: Dax | last post by:
Hi, I have a problema of query in an asp page, if I run the query in sql query analizer is time running it's about 3-4 seconds, if I made the same query in an asp page it create the error of...
0
by: EJO | last post by:
Thanks everyone! My workgroup is in a mixed enviroment for using an Access 2k mde as the front end of a sql server 2000 which is running on the same machine that some of my users access using...
5
by: Omer | last post by:
Hi, I am using C# 2.0 along with MS Access database. All my queries are working perfectly fine, but one inner join query is ocntinously throwing. I ahve tried it both from code and running...
4
by: scorpion53061 | last post by:
My Visual Studio 2005 Query Window reports the following error when this query runs. Any idea what might be causing it? Thanks for any help. I have tried subsitituing for the parameter a fixed...
7
by: Yesurbius | last post by:
I am receiving the following error when attempting to run my query. In my mind - this error should not be happening - its a straight-forward query with a subquery. I am using Access 2003 with all...
3
by: tejasmore | last post by:
Hi, I am running a following query in DB2 and getting SQL0338n error. This is primarily because, there are subqueries at few places (marked in bold)in the main query, after 'ON' clause. Could...
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
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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
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,...
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.