For Executing Complex SELECT Statement with WHERE and GROUP BY Clause - Direct SQL or Talend is best

Six Stars

For Executing Complex SELECT Statement with WHERE and GROUP BY Clause - Direct SQL or Talend is best

Dear Team,

 

I am quite new to talend and exploring it functionality.

 

Recently I came across a complex SQL Select statement something like this,

 

SELECT COLUMN1, CLOUMN2, CLOUMN3, COUNT(ID) AS EMP_COUNT, AVG(DATEDIFF(YEAR,DOB,GETDATE())) AS AVG_AGE 
FROM TABLE 1
WHERE DOJ <= GETDATE()
AND ISNULL(SEPARATIONDATE, DATE(ADD,D,1,GETDATE()) > GETDATE()
GROUP BY 
COLUMN1, CLOUMN2, CLOUMN3

When I am trying to replicate this select statement using talend components, tDBInput, tCombinedSQLFilter, tCombinedSQLAggregate, tCombinedSQLOutput, tDBCommit,tDBInput, tLogRow. (PFA Screen Shot for reference)

 

I feel its quite complicated than writing a SQL statement. So could you please suggest me best approach how we can do this kind of transformations using talend.

 

Thanks in advance.

 


Accepted Solutions
Forteen Stars

Re: For Executing Complex SELECT Statement with WHERE and GROUP BY Clause - Direct SQL or Talend is best

@KathikVenky ,please accept the solution.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

View solution in original post


All Replies
Forteen Stars

Re: For Executing Complex SELECT Statement with WHERE and GROUP BY Clause - Direct SQL or Talend is best

@KathikVenky , You can directly use that query in tDBInput and o that the query burden will be on DB side and you can tune that query y adding hints.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.
Six Stars

Re: For Executing Complex SELECT Statement with WHERE and GROUP BY Clause - Direct SQL or Talend is best

@manodwhb  Thank you mano.

Forteen Stars

Re: For Executing Complex SELECT Statement with WHERE and GROUP BY Clause - Direct SQL or Talend is best

@KathikVenky ,please accept the solution.

Manohar B
Don't forget to give kudos/accept the solution when a replay is helpful.

View solution in original post

2019 GARTNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

Put Massive Amounts of Data to Work

Learn how to make your data more available, reduce costs and cut your build time

Watch Now

How OTTO Utilizes Big Data to Deliver Personalized Experiences

Read about OTTO's experiences with Big Data and Personalized Experiences

Blog

Talend Integration with Databricks

Take a look at this video about Talend Integration with Databricks

Watch Now