Thursday, October 22, 2009

MySql and numbers

I really like MySql!

Both queries work:
SELECT * FROM table1 WHERE numbers_column=4
SELECT * FROM table1 WHERE numbers_column='4'

But that's nothing comparing to:
INSERT INTO table1 (numbers_column) VALUES (4)
INSERT INTO table1 (numbers_column) VALUES ('4')

Which means it's generic enough to write a statement without knowing the data type of the columns.
Was quite helpful in my previous project.

No comments:

Post a Comment