I have a sql query like this:

```
if table1 exist
    if table1 has data
       select * from table1

if table2 exist
    if table2 has data
       select * from table2
...
tableN

```

then I iterate dataset in c#
but even a table does not exist in database, there is an empty result table in dataset, How to write the sql to only return not empty queries? say I have 10 tables, 3 not exist in database, So, only 7 result tables in returned dataset?