MySQL Trigger returns multiple rows -


I have a MySQL 5.5 trigger which is failing due to several results The problem is, I have a unique area 'ID Using the field, I am trying to return a result at a time.

  Create a later insert TRIGGER insert_com_app_title on com_apps to insert each line com_myisam_app_titles check Ignore (Id_company, title) Price ((SELECT a.id_company, b.title a JOIN from com_apps Epf_application b on a.application_id = b.application_id WHERE NEW.id = a.id));  

(relevant) table structure is as follows:

  ** com_apps ** id, id_company, application_id ** com_myisam_app_titles ** id_company, Title * Apif_apeeplikeshn ** Aplikeshn_aid, title  

I think that is wrong with the new IID, although this value is wrong com_apps the id field is a key primary auto-added to the case I will also return a wrong result.

You should not select for nest a value the statement provided in SQL much better syntax:

  insert com_myisam_app_titles (id_company, select the title) a.id_company, a epf_application from b.title check ignore com_apps b Join at a.application_id = b.application_id where new Id = a.id;  

The problem is that the underlying query is returning more than one line and the value statement can not handle it. Up to fix the problem

If you only want a row, a to add the range 1 query:

  Insert com_myisam_app_titles examine carefully Ignore (where id_company, select titles) include b.title one a.id_company, com_apps which a.application_id = on epf_application B b.application_id NEW.id = a.id range 1;  

Comments