3

Specifically, in my prepared statement, can I do something akin to:

... LIMIT  IFNULL(?,1000)

meaning, use the limit passed in as a parameter, but if passed as null use 1000?

So far, my experimenting seems to indicate that a function cannot be used for LIMIT.

Lawrence Dol
  • 63,018
  • 25
  • 139
  • 189
  • A function cannot be used in `limit`. But you can use conditional logic to apply when creating the query string. – Gordon Linoff Mar 01 '14 at 00:10
  • @Gordon: Yep; that's what I am doing now. Just wanted to be sure that I hadn't missed anything in SQL, and it seemed like the kind of question that SO should have an answer for. In fact, if you make your comment an answer, I'd accept it if nothing better comes along. – Lawrence Dol Mar 01 '14 at 00:31

0 Answers0