My query generator