MS SQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesMS SQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now!
  #1  
Old March 26th, 2004, 08:45 AM
Ray_D Ray_D is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 2 Ray_D User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Syntax error

Hello,
I'm an sql newbie. I'm having trouble w/ a select statement. I'm trying to query 3 tables for info. But I keep getting a sytax error in the "where" clause. All 3 tables contain one column that have the same no. This my "link" to each of the tables. Can anyone help me.
Thansk

SELECT
KG_PARCEL.CLT_MAP,
KG_PARCEL.PARC_INSERT, KG_PARCEL.PARC_GROUP,
KG_PARCEL.PARCEL,
KG_PARCEL.ID,
KG_PARCEL.SUBDIV_1, KG_PARCEL.LOC_HOUSE_NUMBER, KG_PARCEL.LOC_STREET_NAME,
KG_ADDRESS.CITY,
KG_ADDRESS.ZIP_CODE,
K_OWNER.OWNER_1,
K_OWNER.OWNER_2,
K_OWNER.OWNER_3,
K_OWNER.OWNER_4, K_OWNER.MAIL_HOUSE_NUMBER, K_OWNER.MAIL_UNIT,
K_OWNER.MAIL_STREET_NAME, K_OWNER.MAIL_STREET_EXTRA, K_OWNER.MAIL_CITY,
K_OWNER.MAIL_STATE,
K_OWNER.MAIL_ZIP_CODE, K_OWNER.MAIL_ZIP_CODE_SUF, K_OWNER.MAIL_COUNTRY
FROM
KG_PARCEL,
KG_ADDRESS,
K_OWNER
WHERE
KG_PARCEL.MSLINK = ?OCCURRENCE? and kg_address.parcel_link = ?OCCURRENCE?KG_PARCEL.MSLINK and K_OWNER.PAR_LINK = ?OCCURRENCE?KG_PARCEL.MSLINK

Reply With Quote
  #2  
Old March 26th, 2004, 08:54 AM
jstrohofer jstrohofer is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Cincinnati, OH USA
Posts: 111 jstrohofer User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 m 3 sec
Reputation Power: 5
I don't know what "?OCCURRENCE?" is...but I'd do something like this...

SELECT
KG_PARCEL.CLT_MAP,
KG_PARCEL.PARC_INSERT, KG_PARCEL.PARC_GROUP,
KG_PARCEL.PARCEL,
KG_PARCEL.ID,
KG_PARCEL.SUBDIV_1, KG_PARCEL.LOC_HOUSE_NUMBER, KG_PARCEL.LOC_STREET_NAME,
KG_ADDRESS.CITY,
KG_ADDRESS.ZIP_CODE,
K_OWNER.OWNER_1,
K_OWNER.OWNER_2,
K_OWNER.OWNER_3,
K_OWNER.OWNER_4, K_OWNER.MAIL_HOUSE_NUMBER, K_OWNER.MAIL_UNIT,
K_OWNER.MAIL_STREET_NAME, K_OWNER.MAIL_STREET_EXTRA, K_OWNER.MAIL_CITY,
K_OWNER.MAIL_STATE,
K_OWNER.MAIL_ZIP_CODE, K_OWNER.MAIL_ZIP_CODE_SUF, K_OWNER.MAIL_COUNTRY
FROM
KG_PARCEL
INNER JOIN KG_ADDRESS
ON KG_PARCEL.MSLINK = KG_ADDRESS.parcel_link
INNER JOIN KG_OWNER
ON KG_PARCEL.MSLINK = KGOWNER.PAR_LINK

I'm not sure if those are your joining fields or not, but you can give it a shot...

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesMS SQL Development > Syntax error


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway