Hi i want to display id from a table having a condition that if id is null then id=300 else max(id)+1 as id from table .
i tried this with case when statement as follows
select case when (conductor_id is null)then 300 else MAX(conductor_id)+1 end as conductor_id from conductormaster
i got the error as
Column 'conductormaster.conductor_id' is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause.
how to solve this