table join and subquery is ok, but not fully tested, and have some restriction in using