Monday, February 27, 2012

check existing mysql triggers

SELECT * FROM information_schema.TRIGGERS WHERE TRIGGER_SCHEMA= 'database_name';

OR

SHOW TRIGGERS;

create mysql triggers


table names
testing.name
testing_T.fullname

CREATE TRIGGER addnm AFTER INSERT ON testing
FOR EACH ROW BEGIN
INSERT INTO testing_T SET fullname =  NEW.name;
END;

delimiter |

Monday, February 6, 2012

find duplicate rows in a mysql table

example field = reference
example table = outstandings


" select reference from outstandings group by reference having count(*)>=2 "