query unique check ids