Please take this survey to help us learn more about how you use third party tools. Your input is greatly appreciated!

equivalent of Cross Apply with function in vertica

I have a select statement like



SELECT
sub.ts AS FULL_DT,
EXTRACT(DOW FROM DATE sub.ts)+1 DAY_IN_WEEK,
EXTRACT (DAY FROM DATE sub.ts) AS DAY_IN_MONTH,
EXTRACT (DOY FROM DATE sub.ts) AS DAY_IN_YEAR

 

I have to perform above select to the dates which are present in another table in vertica

I mean in the above query sub.ts would get replaced by col1 from table1.

table1 has data like

col1

'2016-01-01'

'2016-01-02'

'2016-01-03'

'2016-01-04'

 

For all these 4 row the above select should get executed..This can be achieved using CROSS APPLY and creating function which has the above select statement in SQL.

 

But please let me know how can we achieve same in VERTICA?

 

 

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file

Can't find what you're looking for? Search the Vertica Documentation, Knowledge Base, or Blog for more information.