Select Latest Snapshot Date Data in the Synapse View

Sharukh Kundagol 145 Reputation points
2023-07-24T13:51:15.09+00:00

Hi Team,

I have delta table which will have multiple snapshot dates and I need to create view in synapse server less to select the data for latest snapshot.

something like below, but it is not working can you please assist.

CREATE or ALTER view myiew as 
SELECT top 10  SnapshotDate FROM
OPENROWSET(

               BULK '/SCFW/TransformLayer/TransactionObject/SCFWCategoryWasteManagementSnapshot/',
               data_source = 'adlsLocalPassthrough',
               FORMAT = 'DELTA'
               ) AS SCFWCategoryWasteManagementSnapshot where SnapshotDate
               = ( SELECT max(SnapshotDate) from SCFWCategoryWasteManagementSnapshot);
Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
5,184 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.