how to use a condition while creating a table in sql : I'd like to create a table with a condition


create table TOTO
(
	Id int not null, 
	zip  as (if(zip > '00999' and zip < '96000') then zip) ,
	PRIMARY KEY (Id)
);

All I get is an error message.

Do you know how to do that with the "zip" in type char ?
Thank you for your help !