topicscontroller sqlquery