![](/img/trans.png)
[英]How to create new column based on values after "/" in other column in Oracle?
[英]How to write a create table script based on certain column values in Oracle DB?
是的,可以做到,這是一個只有 2 列的示例,您可以輕松地將其擴展到 3 列或更多:
create table tcon (c1 number, c2 number, constraint ck check ((c1 is not null) or (c1 is null and c2 is not null)));
您可以按照以下方式進行操作,只需確保條件正常即可
create table tableA (
country varchar2(20),
countryCode varchar2(20),
countryshort varchar2(20),
constraint chk check ((country is null and ( countryCode is not null or countryshort is not null) ) or (country is not null and (countryCode is null or countryshort is null)))
);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.