How can i pass one of the values from one function to another as an argument in Databricks SQL?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-29-2022 11:27 AM
For eg -
CREATE OR REPLACE TABLE table2(a INT, b INT);
INSERT INTO table2 VALUES (100, 200);
CREATE OR REPLACE FUNCTION func1() RETURNS TABLE(a INT, b INT) RETURN
(SELECT a+b, a*b from table2);
create or replace function calc(p DOUBLE) RETURNS TABLE(val DOUBLE) RETURN (SELECT a from func1());
select calc(a) from func1();
This throws me an error -
Now, i understand the way i am trying to do this is wrong. Is there any way to do this? If so, then how?
Labels:
- Labels:
-
Databricks SQL
-
Int
-
SQL