Reputation: 33
Help! Can't figur it out what's the problem here --> ORA-00920: invalid relational operator.
alter table kund
add constraint kund_persnr_pk primary key(persnr)
add constraint kund_username_uq unique (username)
add constraint kund_kredittyp_ck check(kredittyp 'hög', 'medel', 'låg');
Upvotes: 0
Views: 173
Reputation: 522752
Do you want to check that the kredittyp
column can have one of three values?
ALTER TABLE kund
ADD CONSTRAINT kund_persnr_pk PRIMARY KEY (persnr),
CONSTRAINT kund_username_uq UNIQUE (username),
CONSTRAINT kund_kredittyp_ck CHECK (kredittyp IN ('hög', 'medel', 'låg'));
Upvotes: 1