Hi all, anyone knows if suiteql supports WITH oper...
# suiteql
d
Hi all, anyone knows if suiteql supports WITH operator? (and how to use it)
I try the following: with t1 as (select * from transactionline where transaction = 1791277) select t1.* from t1 but get Search error occurred: Unsupported type: class com.netledger.sqlquery.model.SqlFactoredSourceReference : t1
d
Thanks @Selcuk Dogru it's working! 🙂
a
But not
WITH RECURSIVE
:(
r
what is the advantage of with? instead of inline like so :
SELECT ID, FullName FROM (SELECT ID, ( LastName || ', ' || FirstName ) AS FullName, Phone, Email FROM Employee) as TestEmployee ORDER BY FullName
a
Can reference the table multiple times. Plus you can have many with statements, each referencing an earlier with. I think you are right that logically there is no query that you can do with a
WITH
statement that you cant pull off with a sub query (at least not until
WITH RECURSIVE
is supported.
r
thx @Alan Fitch makes sense, like a cursor I think
Alan, did you remove the comment?
looked like a function
a
I did. It's a function that gets the fifo status using suiteql it was formatted all wrong.
r
this was a NS function?
if so then I have a lot to learn
a
In a restlet.
r
its going to take a min to unpack this but thank you for the challange.
what does run2dQuery do?
@Alan Fitch that is impressive.. nested queries that build upon each other.. also learned about dense_rank from it.
a
Copy code
def run2dquery(q){
return query.runSuiteQL(q).asMappledResults()
}
It also does paging but essentially that is what it does.