我有四个表,应该检查第一个表的数据,如果不存在,那么应该检查第二个表并继续......
目前可以遵循以下方法
1. Have union all on the tables and find out the above based on priority (Or)
2. Run each query from the application and verify and goes one by one (Or)
3. Using CASE and NOT_EXIST option to find out the rows accordingly
问题:
1. Problem with JPA if all columns are extracted with asterisk (*) since count(c.*)
is not supported in SQL
2. Performance and unnecessary multiple query from application which needs to be
avoided in second approach
3. Makes the query has very complex and not interested to proceed
在这个用例上要遵循的最佳实践是什么?
谢谢