<div dir="ltr"><div dir="ltr">Hi,<div><br></div><div>Am I correct in thinking that the standard library/compiler doesn't support SQL "IN" statements? It's something that I use a lot in my programs, and in psql for example you can just do:</div><div><br></div><div><font face="monospace, monospace">SELECT *</font></div><div><font face="monospace, monospace">FROM uw_lesson_lessons</font></div><div><font face="monospace, monospace">WHERE uw_id in (1, 2, 3)</font></div><div><br></div><div>I made my own function to handle this, using a bunch of sql_or statements:</div><div><br></div><div><div><font face="monospace, monospace">fun inlist</font></div><div><font face="monospace, monospace">      [a ::: Type]</font></div><div><font face="monospace, monospace">      [otherfields ::: {Type}]</font></div><div><font face="monospace, monospace">      [tablename :: Name] </font></div><div><font face="monospace, monospace">      [columnname :: Name] </font></div><div><font face="monospace, monospace">      [otherfields ~ [columnname = a]]</font></div><div><font face="monospace, monospace">      (_ : sql_injectable a)</font></div><div><font face="monospace, monospace">      (ids: list a)</font></div><div><font face="monospace, monospace">    : sql_exp ([tablename = [columnname = a] ++ otherfields]) ([]) ([]) bool</font></div><div><font face="monospace, monospace">  =</font></div><div><font face="monospace, monospace">  List.foldl</font></div><div><font face="monospace, monospace">    (fn id acc => (SQL {acc} OR {{tablename}}.{columnname} = {[id]}))</font></div><div><font face="monospace, monospace">    (WHERE {[False]})</font></div><div><font face="monospace, monospace">    ids</font></div></div><div><br></div><div>I'm not sure about the performance characteristics of this though. Anyway, just wondering if it is already supported but I can't find it, or it's not supported at all? </div><div><br></div><div>Thanks</div><div><br></div><div>Simon</div></div></div>