Hi, anyone having issues with `WITH` statements in...
# suiteql
m
Hi, anyone having issues with
WITH
statements in SuiteQL? I’m running this super basic query with a
WITH
clause but getting a
Invalid search query. Detailed unprocessed description follows. Search error occurred: Unsupported type: class com.netledger.sqlquery.model.SqlFactoredSourceReference : basicwith
error:
Copy code
WITH basicwith AS (
	SELECT
		AccountingPeriod.id
	FROM
		AccountingPeriod
)
SELECT * FROM basicwith
m
I don’t think it likes the *. The below worked for me
Copy code
WITH
  temp_table as (
    SELECT
      AccountingPeriod.id
    FROM
      AccountingPeriod
  )
select
  id
from
  temp_table
m
Thanks! To clarify did you try it with
*
? Your query also didn’t work, but adding a
GROUP BY id
at the end made it work, which makes me think something is wrong with our integration and not the query itself.
m
Yes, it did not work with the * either. I don’t know your specific use case but depending you can use a subquery directly and the * works
Copy code
SELECT
  *
from
  (
    SELECT
      AccountingPeriod.id
    FROM
      AccountingPeriod
  )