Python MySQL

MySQL Limit

Limiting results

MySQL Limit

You can limit the number of records returned from the query, by using the "LIMIT" statement.

Limit Results

mycursor.execute("SELECT * FROM customers LIMIT 5")
myresult = mycursor.fetchall()
for x in myresult:
    print(x)