Check Contraint Question

  • From: Lyndon Tiu <ltiu@xxxxxxxxxxxxx>
  • To: oracle-l@xxxxxxxxxxxxx
  • Date: Fri, 03 Dec 2004 11:46:39 -0800

Hello,

Could use some help here.

Table1 has:

Column1 varchar(32) is non-unique
and
Column2 number(1) with a constraint check (Column2 in ('0','1'))

Now I need to enforce another check constrains that says:

for every distinct Column1, you can only have a max of one Column2 = 
'1'. The rest of Column2 for that distinct Column1 being all '0'.

How do I write the check constraint for this?

Thank you for your help.

--
Lyndon Tiu
--
//www.freelists.org/webpage/oracle-l

Other related posts: