Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

166
Vistas
Using Common Table Expression (CTE) with IN operator

I am trying to define a CTE and then immediately use it in a WHERE clause using the IN operator.

This does NOT work.

WITH T AS (SELECT 1)
SELECT 2 WHERE 1 IN T;

This does work, but I need to add a SELECT.

WITH T AS (SELECT 1)
SELECT 2 WHERE 1 IN (SELECT * FROM T);

Is there a way to get rid of the last SELECT?

I am using this query in the context of Foreign Data wrappers. The addition of the last select prevents the "in-lining" of the intermediate results.

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda