0

I would like to replicate what our database search engine calls a 'multi-field search' in DQL (which is pretty much SQL as I understand).

I'm not sure if this is possible, but the syntax would look something like...

SELECT title, container_no, archive_status 
FROM record_table 
WHERE * like 'search term'

Can it be done? Surely there must be a better way than having a string of...

WHERE column1 = "search term" OR
column2 = "search term" OR
column3 = "search term" OR
etc...

If this were possible, I envisage it would look something like this:

WHERE (column1, column2, column3, column4) like '%search term%'  

Edit 1: Updated pseudo code for clarity

Edit 2: Added additional thoughts

HotSauceCoconuts
  • 301
  • 5
  • 19

0 Answers0