🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: bit.listserv.sqlinfo
Article #253

SQL LIKE %%

#253
From: 1961
Date: Mon, 27 May 2002 17:16
26 lines
1979 bytes
Hi!
I am working on a recruitment site that allows people to search
the database for POSITIONS.
When this is called from a user submit/search form
the passed URL parameter is turned into the variable VARpos.
Using LIKE  '%VARpos%'  this will return 'similar' results, as in if
the search is for 'manager' this will also find 'assistant manager'..etc
---------------------
SELECT *
FROM vacancies
R_POSITION_1 LIKE '%VARpos%'
-------------------------------------------------------

My problem is that I now want to find matching entries in two database
tables.
This is fine is they are exactly the same, but I can't figure out how to use
the LIKE statement, as used above.
--------------------------------------------
SELECT *
FROM vacancies, Register
WHERE R_POSITION_1 LIKE position
---------------------------------------------------------
using % just gives an error.
Basically how can I turn an extracted field from the table and
use that as the variable VARpos to find similar/ LIKE matches in the other
table
Technical Details
Message-ID: <actpoe$5a5$1@news8.svr.pol.co.uk>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!diablo.theplanet.net!news.theplanet.net!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 11355a,3cf78f771419ebd8,start
X-Google-Attributes: gid11355a,public
X-Google-ArrivalTime: 2002-05-27 10:18:07 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!diablo.theplanet.net!news.theplanet.net!not-for-mail
From: "1961" <robson1961@robson1961.freeserve.co.uk>
Newsgroups: bit.listserv.sqlinfo
Subject: SQL LIKE %%
Date: Mon, 27 May 2002 18:16:11 +0100
Lines: 29
Message-ID: <actpoe$5a5$1@news8.svr.pol.co.uk>
NNTP-Posting-Host: modem-5.androstenedione.dialup.pol.co.uk
X-Trace: news8.svr.pol.co.uk 1022519886 5445 62.136.80.5 (27 May 2002 17:18:06 GMT)
NNTP-Posting-Date: 27 May 2002 17:18:06 GMT
X-Complaints-To: abuse@theplanet.net
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 5.50.4133.2400
X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400