I need to split the query in list of elements where the 1st element has "select attribute", the 2nd element has "from" then next has "join" and