How to display a default value instead of blank if the table is empty?

Apply OS: Windows

Apply Navicat Product: Navicat for MySQL, Navicat for MariaDB, Navicat Premium

Apply Navicat Version No.: ALL


You need to change the SQL manually . To do this, please follow steps below:

  1. In the Query Designer, select SQL tab.
  2. Right click the SQL statement and choose Edit SQL.
  3. Edit the SQL like the following:

    SELECT

    CASE WHEN COUNT(Time_field) = 0

    THEN "00:00:00" ELSE Time_field

    END AS Total_Time

    FROM table_name

For more information, please refer to - http://dev.mysql.com/doc/refman/5.1/en/case-statement.html

Have more questions? Submit Ticket.
Have more questions? Submit a request

0 Comments

Article is closed for comments.