简体   繁体   中英

How to handle minus operator with SOCI library?

I need to use SOCI library to handle minus operator in a database agnostic way. Oracle keyword 'MINUS' does not support in postgres and respective postgres keyword is 'EXCEPT' . Ex : Oracle Syntax SELECT COUNT(*) FROM (SELECT C1 FROM s1.T1 **MINUS** (SELECT C1 FROM S2.T1));

Postgres Syntax SELECT COUNT(*) FROM (SELECT C1 FROM s1.T1 **EXCEPT** (SELECT ENTITY_ID FROM C1 FROM s2.T1));

Likewise SOCI library provide a function to handle nvl ('''soci::session::nvl()'''), is there any capability to handle minus operator as well?

Yes. SOCI library has provided a function call soci::session::except() function to fulfill this requirement.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM