I have 2 tables:
- category(
inter_archi_cat
table) and their linking with other - entities(
inter_archi
table )
I want to select only categories which linked to any entity.
SELECT *
FROM inter_archi_cat
WHERE id IN (SELECT GROUP_CONCAT(DISTINCT sub_cat) as allcat
FROM inter_archi)
If I ran the subquery individually, I'm giving correct results (apx 40 records). But while running with main query its giving only 1 record.