BitnineGlobal / agensgraph

Apache License 2.0
18 stars 4 forks source link

Question : I want to use Cypher and SQL(WITH Statement) at the same time as hybrid queries. #19

Open JeongTaekgyu opened 4 weeks ago

JeongTaekgyu commented 4 weeks ago

I know, Hybrid Query Language is available.

I want to use Cypher with ANSI SQL ( WITH Statement ) as below.

For example, I would like to use the following queries.

WITH numbered_data AS (
    SELECT 
        ott,
        국가,
        ROW_NUMBER() OVER (ORDER BY ott) AS row_num
    FROM 
        zero1_4_3.tb_nott1
) 
SELECT * FROM numbered_data as nd WHERE row_num BETWEEN 1 AND 10000
CREATE (: z_nott1 = JSONB_STRIP_NULLS(ROW_TO_JSON(numbered_data)::JSONB));

It is SQL until the previous row of 'CREATE' and Cypher from the row of 'CREATE'. But, this Query is not running.

Query result gave this error as below

SQL Error [42601]: ERROR: syntax error at or near "CREATE"

How can I use 'Cypher(from CREATE)' and ANSI SQL( WITH statement ) at the same time?

Would kindly have a look as soon as possible? Thank you.