I have a parent table like this:
id | name
-------------
1 | item a
2 | item b
and have a chid table with a column with 2 posible types
parent id | name | type
-------------------------------
1 | subitem a | t1
1 | subitem b | t1
2 | subitem c | t2
2 | subitem d | t1
2 | subitem e | t2
there is a way to make a select with the following result?
parent id | childs type t1 | childs type t2
-----------------------------------------------
1 | 2 | 0
2 | 1 | 2
any ideas? Thanks!!