Here is my table:
page_id | string_id | content
1 | terms_en | etc text lorem ipsum
1 | terms_es | etc espanol lorem
2 | tabtext | stuff text lorem etc
3 | veh_name | etc stuff letters lala
4 | btn_txt | text for a button etc
4 | alert_txt | text for an alert etc lala
5 | page_cnt | lala pagecontent etc lala
I need to select all of the page_ids where the page_id only has one string_id associated with it
In essence, I am trying to return the page_ids: 2, 3, and 5 from this table.
My SQL looks like this:
SELECT page_id, string_id
FROM lang_strings
WHERE string_id != 'content'
GROUP BY string_id, page_id
HAVING count(string_id) < 2 AND count(page_id) < 2;