If no rows exists in the database meeting the WHERE condition, a SELECT does give no output. That's how SQL works.
All you can try is a SELECT without a table name or from dual or whatever the correct syntax is for your DBMS. For example, in MS SQL Server, SELECT 1 results in 1. And http://stackoverflow.com/questions/1881853/select-without-a-from-clause-in-oracle gives an example in Oracle to output 100 records from dual.
How to get all month name when we select data from datatable in SQL using between query from date and to date parameter and no record exits in table. But I want all month name between from date and to date.