main logo
Subject: Re: SQL dilema
Author: Gerald Harden
Posted: 2000/11/30 10:29:48
 
View Entire Thread
New Search


on 11/30/00 2:26 AM, Ruslan Zasukhin at sunshine .at. public .D.O.T kherson.ua wrote:

> on 30/11/00 06:26, Gerald Harden at wonderhorse@earthlink.net wrote:
>
> Hi Gerald,
>
>> First, I would like to thank everyone for their replies to my previous
>> difficulty understanding SQL. I have reorganized my database as below. I can
>> get the right reply if I ask for the names of everyone in one specific city
>> and state (ie Atlanta, Georgia). However, I don't seem to have the right SQL
>> syntax to get the names of everyone in two cities in one state (ie
>> Baltimore, Maryland and Olney, Maryland) or two cities and two states (ie
>> Atlanta, Georgia and Baltimore, Maryland). Any suggestions?
>
> SELECT Name
> FROM TablePeople, TableHomes TableCities, TableLocation, TableStates
> WHERE (City = 'Baltimore' OR City = 'Olney') AND State = 'Maryland'
>
>
>> TablePeople
>> [Name]
>>
>> TableStates
>> [State]
>>
>> TableCities
>> [City]
>>
>> TableLocation
>> [TableStates-ptr] [TableCities-ptr]
>>
>> TableHomes
>> [TablePeople-ptr] [TableLocation-ptr]
> ^^^^^^^^^^ probably TableCity-ptr ?

Thanks, I see. I needed brackets.

Jerry


-------------------------------------------------------------
The Valentina mailing list is brought to you by MacServe.net
For info on lists services, see http://www.macserve.net/lists.html
 
©2000 Gerald Harden
<-- Prior Message New Search Next Message -->