SQL Server: Dynamic where-clause

前端 未结 3 2000
慢半拍i
慢半拍i 2020-12-02 01:56

Problem:

Ajax suggest-search on [n] ingredients in recipes. That is: match recipes against multiple ingredients.

For instance:

3条回答
  •  一整个雨季
    2020-12-02 02:57

    Depending on how you are processing the input ingredients I think this current method has some sql injection risks.

    You could append the ingrediant name to the join conditions which may be quicker.

    You could also hash combinations of ingredients for receipes for a quick lookup.

提交回复
热议问题