Query decode