Some effective common usage of SQL statements in Oracle

zhaozj2021-02-16  76

1. Find data not available in Table B in Table A

Select DJBH from ZJ_SPLZYJB A Where Not Exists (Select Djbh from ZJ_SPLZB B Where A.djbh = B.DJBH)

2. Search DJBH in Table A, XH two fields are not unique records, that is, repeated records

Select DJBH || '-' || xh as djbhxh, count (djbh) from zj_fybxbd b Group by Djbh, XH

转载请注明原文地址:https://www.9cbs.com/read-11976.html

New Post(0)