Basenetix
Android Apps You Can't Live Without!
-
MySQL gotcha when using non-compulsory foreign keys
Posted on January 27th, 2010 No commentsI’m just writing a query at the moment that filters out test records from a database. These records have a foreign-keyed value that identifies test apps, e.g. a table with: id name 1 TEST 2 ANOTHER_VALUE 3 SOMETHING_ELSE This is joined onto the main data table, sensibly with a query like this: SELECT * FROM the_data LEFT JOIN the_values ON the_data.some_value = the_values.id WHERE the_values.name != 'TEST' The gotcha is however, that this doesn’t work as you’d expect
Read more here:
Sphere: Related Content
MySQL gotcha when using non-compulsory foreign keys
17, Eye, IDE, James, SQL, amp, base, check, coding, data, database, filter, gotcha, http, in, ing, join, key, left, like, me, mysql, name, no, not, null, query, record, simple, solution, something, table, test, to, value, values, work amp, base, gotcha, identifies-test, instance, joined-onto, null, onto-the-main, query, record, simple, simple-once, table, work












































