Instead of
(select max(c) from t where n=20)+1
try
select coalesce(max(c)+1, 1) from t where n = 20
Regards
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
If I have a table that is empty and I want to compute an incrementing value in a
non-unique column (I cannot use integer primary key since the column value won't be
unique):
(select max(c) from t where n=20)+1
where c is unique only within (n==20), then this works as long as the table has at
2 matches
Mail list logo