469,110 Members | 1,997 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,110 developers. It's quick & easy.

LIKE operator and percent mark (%) syntax in comparison queries

I operate with 2 tables: tbLocations and tbDepartments. Both have a column
named Town.

tbLocations.Town looks like long unique list of different towns world wide:

Copenhagen

Madrid

Roma

Oslo

Kiev

Toronto

Stockholm

Moscow

so on

tbDepartments.Town looks like this:

Madrid Kiev

Roma Madrid Oslo

Madrid

Kiev

I need to create a query, which uniquely extracts Towns from
tbLocations.Town or from tbDepartments.Town that only exist in
tbDepartments.Town. Something like this:

Madrid

Kiev

Roma

Oslo

I have composed a query which partially solves problem:

"SELECT tbLocations.Town FROM tbLocations, tbDepartments WHERE
(tbLocations.Town LIKE tbDepartments.Town)"

Unfortunately it extracts only single word records, like this:

Madrid

Kiev

Despite my attempts to use some combinations of wildcards, percent mark (%)
and variations of upper commas after LIKE operator I couldn't get satisfied
results.

Platform: ASP; DB engine: MySQL

Any help will be greatly appreciated

Regards / Vlad
Jul 20 '05 #1
0 1653

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Tony | last post: by
5 posts views Thread by Jim Devenish | last post: by
7 posts views Thread by =?ISO-8859-2?Q?Gregor_Kova=E8?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by kglaser89 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.