Mysql limit records depending on size output -
I am thinking that it is possible to limit the number of records because the output of a query based on size (KB) In particular the output of my database, there is a table in which a long description can occur. For example, LIMIT 0,15 for example, fifteen records can have a bigger description or simple one, but I would like to get a certain amount of data (automatically increase or decrease the number of records) Is there any other instructions for limiting?
Another option is getting the number of characters, summarize them, set a boundary and join the original query. But I think that this is not the best way.
You do this by keeping track of length In a variable and then stopping when some threshold is crossed: Choose descr. from
Select descr, @ size: = size @ size (descr) of the table size As the length (descr) size: = 0) in the form of T) where the size & lt; = 100000;
Your definition of length of each record can be more sophisticated, but it should give you this idea.
Comments
Post a Comment