Tuesday, 20 August 2013

Missing values after joining tables in SQLite

Missing values after joining tables in SQLite

This is relationship between tables in SQLite database. There I am trying
to join 5 tables.

SELECT * FROM r_ele
WHERE r_ele.value LIKE '‚Å‚à%'
Query above returns this result(which is ok). The table next to this
missing words in red!
But when I try join tables, some values are missing.
SELECT e.id AS entry_id,
re.value AS re_value,
GROUP_CONCAT(DISTINCT ke.value) AS ke_value,
GROUP_CONCAT(DISTINCT g.value) AS g_value
FROM (entry e
INNER JOIN k_ele ke ON e.id = ke.fk
INNER JOIN r_ele re ON e.id = re.fk
INNER JOIN sense s ON e.id = s.fk
INNER JOIN gloss g ON s.id = g.fk)
WHERE g.lang IS NULL AND re_value LIKE '‚Å‚à%'
GROUP BY re.value
ORDER BY re_value;
Result:
What I am doing wrong? What should I do in order to avoid missing some
values from table 'r_ele'?

No comments:

Post a Comment