revisions to json sql select