First sql to JSON method