Left Join query causing 'Column not found' error
You made 2 mistakes:


For complicated queries, use db_select(), not db_query(). That way you will use enough of built-in failsafes to know what exactly went wrong.
If you insist on db_query(), or need an UNION or something db_select() simply cannot create, never use unbracketed full table name. That's why aliasing exists.


Your query should look about like that:

$result = db_query("SELECT nid, type FROM {node} n
LEFT JOIN {field_data_field_test} f
ON n.nid = f.entity_id
WHERE n.type IN (:type) AND LOWER(n.title) = LOWER(:title)
AND f.field_test_value = :test_value",
array(':type' =&gt; $node_types, 'title' =&gt; $page_name, 'test_value' =&gt; $tvalue,));