Hi,
First of all, thank you so much for your excellent work.
From FAQ, I understand Hibernate does not support Union.
After searching through Internet, I found several people recommending to use View as an alternative to Union.
Could somebody tell me how to do this?
For example, let's say I want to get distinct list of IDs from two tables.
I can use CREATE VIEW to extract ID lists from the two tables.
CREATE VIEW viewA AS
SELECT ID FROM TABLE_A
CREATE VIEW viewB AS
SELECT ID FROM TABLE_B
But I still end up with two views. I can't combine them using Union.
I also tried inserting viewA into viewB. This didn't work for MS SQL Server because it doesn't seem to allow insert into View. This option seems to have a compatibility issue among different databases.
So what is the best way of using View as an alternative to Union?
Any advice shall be appreciated.
Thank you!
|