I need to insert the record in the database only if the count is less than 'n'.
ie if i need to enter a name first i need to find the count of name if it is less than 2 then isert the name and if it is more than 2 then it should not be entered,
i tried but it does not work where did i go wrong??
insert into tablename values('aaa') where count(*)columnn ame <=2
I think where could not be used with aggregate functions instead of that what has to be put?
ie if i need to enter a name first i need to find the count of name if it is less than 2 then isert the name and if it is more than 2 then it should not be entered,
i tried but it does not work where did i go wrong??
insert into tablename values('aaa') where count(*)columnn ame <=2
I think where could not be used with aggregate functions instead of that what has to be put?
Comment