SAP Home Learn Build Integrate Model Operate Extend with AI ConnectTutorial navigator Knowledge Graph API Devtoberfest Developer Advocates App Space

Manage my Account SAP Devs YouTube ↗ Learnings ↗ Community ↗ Provide Feedback ↗
Logout
โคข Open full site

View Data Across Both In-Memory and Dynamic Tiering Tables Using a SQL View

Create and use a SQL view to query data from both in-memory and dynamic tiering tables.

Overview

🎓 beginner 15 min. SAP HANA Dynamic TieringBeginnerSqlSAP HANASAP Web Ide

You will learn

  • โœ”How to view the combined data set for data partitioned between an in-memory and a dynamic tiering table instance.
  • โœ”How to create and use a SQL view.
  • โœ”How to query against a SQL view with conditions.
Unknown U Unknown November 1, 2022
Created by June 20, 2018
Contributors

Prerequisites

Prerequisites

Steps

Next Steps

Time to Complete

5 Min


Step 1 Query from both in-memory and dynamic tiering tables
โ€”

There are cases where you only need to access data either from the in-memory table instance (ORDERS_CS) or from the dynamic tiering table instance (ORDERS_DT). However you will also likely have use cases where you need to query the full data set across both table instances, which can be done with a union. Run the script below in a SQL Console to query data from both in-memory and dynamic tiering tables using a UNION.

SQL
SELECT * FROM "TPCH"."ORDERS_CS"
UNION ALL
SELECT * FROM "TPCH"."ORDERS_DT"

Since we are explicitly managing the data set between ORDERS_CS and ORDERS_DT to ensure that data is not duplicated between the 2 tables, we can use the UNION ALL variation of the UNION clause, which is faster because it doesn’t eliminate duplicate records in the combined result set.

Union Query
Union Query

Step 2 Create and query against a SQL view
+

Resources

Discussion

Share feedback on this tutorial or join the conversation in SAP Community.

Submit detailed feedback Discuss in Community
Steps
Step 1 of 2
1. Query from both in-memory and dynamic tiering tables 2. Create and query against a SQL view

Learn more →