Request #12375: fix selection table query