I have a table StateCounty with State and County. The table can also be empty.
I want to use the values from these tables as parameter to get data from zip table like
select * from tblzip where tblZip.State in (select distinct State from StateCounty) and tblZip.County in (select distinct county from statecounty)
Now this would work as long as there is some data in the state county table. But if the statecounty table is empty, then I want all data from tblZip. How to achieve this?
I want to use the values from these tables as parameter to get data from zip table like
select * from tblzip where tblZip.State in (select distinct State from StateCounty) and tblZip.County in (select distinct county from statecounty)
Now this would work as long as there is some data in the state county table. But if the statecounty table is empty, then I want all data from tblZip. How to achieve this?