3

I have a Type column in my database, which contains the entity type, from a set of defined strings. How can I make a query like:

SELECT * FROM "Table" WHERE "Type" IN ('a','b','c');

The IN condition doesn't seem to be supported by Medoo, and even a WHERE condition like

'OR' => [
    'Type' => 'a',
    'Type' => 'b',
    'Type' => 'c',
]

will not work for the duplicated keys.

Mkoch
  • 1,994
  • 2
  • 13
  • 21

1 Answers1

2

IN is supported by Medoo & is used like this:

$database->select("table", "*", [
    "type" => ['a', 'b', 'c']
  ]
);

// Its equivalent to : ...WHERE "type" IN ('a','b','c') ...
behkod
  • 2,647
  • 2
  • 18
  • 33