I have a MySQL database containing 10,000 records and I want all select queries to return only 30 rows or less without mentioning the limit clause in the queries
is this possible?
CodePudding user response:
You can set SQL_SELECT_LIMIT
Documentation
It defines maximum number of rows, that will be returned from SELECT statements.
SET SQL_SELECT_LIMIT = 1;
If a SELECT has a LIMIT clause, the LIMIT takes precedence over the value of sql_select_limit.
This parameter can be set global or per session.