lundi 18 juillet 2016

Column not found - ignore

I was wondering if there was a way to make MySQL just ignore missing columns in a query?

For example a table that has columns id, name, age and I try to insert something like

INSERT INTO table (id, name, age, gender) VALUES (null, 'John', 21, 'male');

I will get

[Err] 1054 - Unknown column 'gender' in 'field list'

Is it possible to make MySQL insert values into whatever columns exist and just ignore the ones that don't?

Aucun commentaire:

Enregistrer un commentaire