Ciao a tutti ho questa tabella:

|ID|IDCat|Categoria|SottoCategoria

Or aio devo estrarre distintamente le categorie con le rispettive sottocategoria a cui appartengono, ho provato così:

Codice PHP:
"SELECT IDCategoria as id, Categoria FROM tabella WHERE IDCategoria IN (SELECT SottoCategoria FROM category WHERE IDCategoria='id'" 
così non va mi da errore come posso modificarla?