If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > syntax error for 'INNER JOIN'

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-24-04, 12:21
deepblues deepblues is offline
Registered User
 
Join Date: Jun 2004
Posts: 2
syntax error for 'INNER JOIN'

hi all,

I have a weird problem, which i'm unable to understand.


I created a SQL query using 'INNER JOIN' and my query is

SELECT
datackt1.`D_CKT`, datackt1.`D_SIGNAL`, datackt1.`D_BLDG1`,
dwo1.`DWO_TYPE`, dwo1.`DWO_CURREN`

FROM
{ oj `datackt` datackt1 INNER JOIN `dwo` dwo1 ON
datackt1.`D_STANUM` = dwo1.`DWO_CKT`}


WHERE
dwo1.`DWO_CURREN` = 'Y' AND
(datackt1.`D_SIGNAL` = '10BaseT' OR
datackt1.`D_SIGNAL` = '100BaseTX') AND
(dwo1.`DWO_TYPE` <> '*CANCEL*' AND
dwo1.`DWO_TYPE` <> 'Cancelled DWO' AND
dwo1.`DWO_TYPE` <> 'Deactivate' AND
dwo1.`DWO_TYPE` <> 'Information Only')

where datackt and dwo are my database tables.

when i try to run this query i get a message :

ODBC error: [MySQL][ODBC 3.51 Driver][mysqld-4.0.16-nt] you have an error in your SQL syntax .check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN 'dwo' dwo1 ON datackt1, 'D_STRANUM'=dwo1.'DWO_CKT'}

i verified that the fields D_STRANUM and DWO_CKT are of the same type.

i'm using crystal reports to generate queries.

I'm new to SQL. can anyone help me.
Reply With Quote
  #2 (permalink)  
Old 07-26-04, 03:52
antzs antzs is offline
Registered User
 
Join Date: Jul 2004
Posts: 1
Syntax Error for JOIN

After removing {oj ... } the JOIN statement above will work.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On