Added and modified functionlity for sql joined table.