Quantcast
Channel: SCN : All Content - SAP HANA Developer Center
Viewing all articles
Browse latest Browse all 6745

DDL view: use dynamic select statement in where clause

$
0
0

Hi,

 

I'm creating a DDL view and would like to add a dynamic parameter in my where clause:

 

I found following statement on the net:

 

VIEW MyView AS SELECT FROM Employee

{

  orgUnit,

  count(id) AS headCount,

  sum(salary) AS totalSalary,

  max(salary) AS maxSalary

} GROUP BY orgUnit

  WHERE joinDate > date'2011-01-01';

 

my goal is to get the current_date and add it somehow in the above view like this:

 

VIEW MyView AS SELECT FROM Employee

{

  orgUnit,

  count(id) AS headCount,

  sum(salary) AS totalSalary,

  max(salary) AS maxSalary

} GROUP BY orgUnit

  WHERE joinDate > date = current_date;

 

 

can this be achieved?

 

in general: what is the statement to create a dynamic where clause?

 

thank you,

Maggie


Viewing all articles
Browse latest Browse all 6745

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>