Linked Questions

170 votes
8 answers
181k views

I have been seeing quite a large variation in response times regarding LIKE queries to a particular table in my database. Sometimes I will get results within 200-400 ms (very acceptable) but other ...
Jason's user avatar
  • 2,469
8 votes
2 answers
12k views

I'm writing an inefficient query as follows: WHERE (Field iLIKE '%cat%' OR Field iLIKE '%dog%' OR Field iLIKE '%animal%' OR Field iLIKE '%pet%') whereas what I would like to write is: WHERE Field ...
ZJAY's user avatar
  • 2,917
0 votes
3 answers
2k views

I'm new to ROR and trying to implement search in PostgreSQL database using Active Record. I've found that to make search case insensitive I can use ILIKE operator instead of equals and LIKE but not ...
Oles Malkov's user avatar
0 votes
3 answers
4k views

Is it possible to match a list of patterns in SQL? I know of the following way to match a single pattern: SELECT * FROM table where title LIKE '%match%' This can be expanded like: SELECT * FROM table ...
Ditlev Jørgensen's user avatar
3 votes
1 answer
1k views

This is very much like PostgreSQL wildcard LIKE for any of a list of words, except instead of wanting to match on a static list of words, I want to match on a list of words returned by a subquery. ...
Michael Pell's user avatar
  • 1,476
1 vote
2 answers
1k views

Say I have a Product table with a json array attribute called "name". For example, Product.first.name == ["large", "black", "hoodie"]. I want to search through my database for Products with names that ...
Joe Morano's user avatar
  • 1,923
0 votes
1 answer
2k views

I am using postgresql with jpa in playframework 2.2. I am trying to use like with in in my JPQL by using similar to something like this thread. select * from table where lower(value) similar to '%(foo|...
singhakash's user avatar
  • 7,919
0 votes
2 answers
1k views

I have two tables temp and md respectively. There is a field called uri_stem which has certain details that I want to omit from temp but not from md. I need to make a comparison that is able to ...
user3455309's user avatar
0 votes
4 answers
113 views

I have a model called Story, which has — and belongs to many — Tags. I'm trying to create functionality to display only certain stories based on the story attributes. I do this by chaining ...
RFlaum's user avatar
  • 29
0 votes
1 answer
55 views

I have a field which contains text string, for example: Credit for an item Credit for menu Debit for food Credit for food Debit for Delivery Etc. I want to categorize them into two categories ...
Leo Veynberg's user avatar