I have column c in Table A and Table B,How do i write criteria query for a where clause:
select * from A a,B b where Ac=NVL(B.c,'Constant');
Please help?
The NVL
function behaves similarly to COALESCE
, the latter which is natively supported by Hibernate query language. So, you may use COALESCE
instead:
select * from A a, B b where A.c = COALESCE(B.c, 'Constant');
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.