Skip to main content
Solved

Hi, im trying to replicate some SQL querys from old database in Access. The actual database is in PostGIS. The problem is there a first query, and the second one is making a join from first one's results.

  • December 5, 2023
  • 2 replies
  • 32 views

pabloolivaresm
Supporter
Forum|alt.badge.img+5

The firs one query is first query 

And the second one is second queryThen I need to do a join with this second query and create a list with the results.

I dont know if with the SQL Executor transformer I can replicate this two querys.

 

Any idea?

 

Thanks

Best answer by ctredinnick

Yeah, you should be able to write it in one statement using a CTE. ie

 

with _FME_Gare_ETC_SQ as (

SELECT ...

)

 

SELECT ...

FROM Gare LEFT JOIN _FME_Gare_ETC_SQ ON ...

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

ctredinnick
Supporter
Forum|alt.badge.img+19
  • Supporter
  • Best Answer
  • December 5, 2023

Yeah, you should be able to write it in one statement using a CTE. ie

 

with _FME_Gare_ETC_SQ as (

SELECT ...

)

 

SELECT ...

FROM Gare LEFT JOIN _FME_Gare_ETC_SQ ON ...


pabloolivaresm
Supporter
Forum|alt.badge.img+5

Yeah, you should be able to write it in one statement using a CTE. ie

 

with _FME_Gare_ETC_SQ as (

SELECT ...

)

 

SELECT ...

FROM Gare LEFT JOIN _FME_Gare_ETC_SQ ON ...

yeah! thanks @ctredinnick​ I tryed in PGADMIN4 and it works fine. In FME I had to add some file as iniciator for SQL Executor.

 

Thanks