PPRuNe Forums - View Single Post - MySQL SELECT help please...
View Single Post
Old 11th June 2017 | 14:41
  #1 (permalink)  
windriver
20 Anniversary
 
Joined: Feb 2006
Posts: 669
Likes: 0
From: UK
MySQL SELECT help please...

I have a large MySQL database containing keywords or phrases relating to pre 1980 aviation topics.
Searching this is quite literal and very hit and miss so I'd appreciate some help in creating a suitable SELECT statement with perhaps some regular expressions to eliminate the more usual problems. (currently just LIKE %%)
Typically the database contains designations according to the source material. Users can't be expected to enter precise terms and manufacturers blurb doesn`t necessarily remain consistent over time. Hyphens spaces and other marks appear and disappear regularly.

Some illustrative examples:
Rolls-Royce Rolls Royce (hyphen omitted in search box - search fails)

C130 C 130 (space in search box - search fails)

Shorts SD3-30 (SD330 Shorts 330 Short SD 330 Shorts 3 30 searches all fail)
Mark 2 Mk II (Mark II Mark 11 Mk 2 Mk 11 M.K. II etc may not work)

Lockheed L-1011 TriStar (Lockheed L1011 L-1011 Tri Star may not work)

BOAC (B.O.A.C fails)

I'm sure you can imagine dozens more along similar lines
In short I think most of the problems would be resolved if the search was less touchy about spaces & punctuation marks . ,

Thanks
windriver is offline  
Reply