How to control the command behavior to return a single row