Name

SHOW WARNINGS

Synopsis

SHOW [COUNT(*)] WARNINGS [LIMIT [offset,] count]

Use this statement to display warning messages, error messages, and notes for previous SQL statements for the current session. To get a count of the number of such messages, use the COUNT(*) clause. You cannot use this with the LIMIT clause. The LIMIT clause is used to limit the number of messages displayed. An offset can be given along with the limit to specify a starting point for displaying messages. This statement is available as of Version 4.1 of MySQL. Here are a couple of examples of how you can use this statement:

SHOW WARNINGS;
SHOW COUNT(*) WARNINGS;

The first line displays all messages in an ASCII-formatted table. The second line returns the number of messages. Here’s another example, but with the LIMIT clause:

SHOW WARNINGS LIMIT 3,2;

Get MySQL in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.