vishal
12/22/2022, 11:24 AMid, name, position, timestamp
1,vishal,SDE1,
2,Raj, SDE2
1,vishal, SDE2
1,vishal,NULL
here i am try to featch data for id=1 so SQL query will be SELECT position FROM table where id=1 it will return 3 records.
but i want only one record which is 1,vishal,SDE2 .
can we achieve through scalar function lets say we will pass id as arg and fetch all data in that function get write a logic which will merge the rows and return one string which is concat of all columns.
EX.:
SELECT data(1) FROM table;
def of data func(id) {
select all the data which has id=1 and merge those record and return one single string
}
is it possible? can we query inside the function? or we need to call api to query data inside the function?vishal
12/22/2022, 11:27 AMMayank
Mayank