added the first feature: get the sql select