Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在创建一个需要电话号码列的表格。
我必须做的一个限制是第一个字符必须是“0”。
我该怎么做呢?
alter table YourTable add constraint CHK_YourTable_PhoneNr check (PhoneNr like '0%')
甚至更简单:
create table tab_name( phone_nr type char(15) check ( phone_nr like '0%' ) );