mysqlsqlselectturing-complete

SELECT no rows and no columns?


Is it possible to write a SELECT statement, which returns dataset with zero rows and zero columns?


Solution

  • A dataset will always have at least 1 column, even if it contains no data.

    SELECT NULL;
    

    EDIT:

    As pointed out by @eggyal , above syntax will return a null row.

    His query select null from dual where false; wont return a row.