Isomorphic,
As we know in any data source, we have
SELECT <selectClause>
FROM <tableClause>
WHERE <whereClause>
GROUP BY <groupClause>
ORDER BY <orderClause>
These are straight forward for building queries like the below
SELECT FirstName, LastName, Age, Salary
FROM Employee
ORDER BY Salary
If i have a query with one or more sub query, how can that can be achieved?
For Example,
I know here we can do department in ('a','b') But in my business case, we need to have sub queries with unions. How can we achieve this.
Can we also use velocity macros to generalise. If so, where to put these macros?
In the above query, except the where clause, everything would be same, so we can write a macro with one parameter and call that.
Let me know your thoughts on this. It would be very helpful in our process.
Thanks,
Yathish
As we know in any data source, we have
SELECT <selectClause>
FROM <tableClause>
WHERE <whereClause>
GROUP BY <groupClause>
ORDER BY <orderClause>
These are straight forward for building queries like the below
SELECT FirstName, LastName, Age, Salary
FROM Employee
ORDER BY Salary
If i have a query with one or more sub query, how can that can be achieved?
For Example,
Code:
SELECT Name, age, Salary FROM ( SELECT FirstName as Name, age, Salary FROM Employee WHERE Department='Computer Science' UNION ALL SELECT FirstName as Name, age, Salary FROM Employee WHERE Department='ELECTRONICS' ) ORDER BY age
Can we also use velocity macros to generalise. If so, where to put these macros?
In the above query, except the where clause, everything would be same, so we can write a macro with one parameter and call that.
Let me know your thoughts on this. It would be very helpful in our process.
Thanks,
Yathish
Comment