Skip to content
Advertisement

Tag: sql-delete

About “group function is not allowed here”

I have a table with job, salary and date columns. I am writing the following query in PL/SQL, but I am getting an error group function is not allowed here How can I solve this problem? Answer Your query makes no sense (to me, at least). What does that average salary represent? Whose average salary? Here’s an example based on

Delete all duplicates except first one mysql

I have a table with a column serial_number that is repeated a few times. How would I delete the entire row except the first duplicate? By the following, I can select all the duplicates. But can’t delete. SELECT serial_number, COUNT(*) FROM trademark_merge GROUP BY serial_number HAVING COUNT(*) > 1 Answer Assuming that the primary key of your table is id,

Delete with inner join and trigger throw error: Can’t update table ‘table_b’ in stored function/trigger

Why the following error (Can’t update table ‘table_b’ in stored function/trigger because it is already used by statement which invoked this stored function/trigger) appears after i try to delete with inner join? Can i solve it? Answer I don’t see the point for a trigger here. The functionality you want can be achieved by just adding the on delete cascade

Advertisement