79207836

Date: 2024-11-20 15:21:36
Score: 4
Natty: 4
Report link

How do I retrieve John Doe and Will Smith without also retrieving John Smith in one database round-trip?

DB_ROM.relations[:names]
    .where do
        (first_name.ilike('John') & last_name.ilike('Doe')) | 
        (first_name.ilike('Will') & last_name.ilike('Smith'))
    end.to_a

More info: https://rom-rb.org/learn/sql/3.3/queries/

Reasons:
  • Blacklisted phrase (1): How do I
  • Low length (0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): How do I
  • Low reputation (0.5):
Posted by: Edgar