YMatrix
Quick Start
Connecting
Benchmarks
Deployment
Data Usage
Manage Clusters
Upgrade
Global Maintenance
Expansion
Monitoring
Security
Best Practice
Technical Principles
Data Type
Storage Engine
Execution Engine
Streaming Engine(Domino)
MARS3 Index
Extension
Advanced Features
Advanced Query
Federal Query
Grafana
Backup and Restore
Disaster Recovery
Graph Database
Introduction
Clauses
Functions
Advanced
Guide
Performance Tuning
Troubleshooting
Tools
Configuration Parameters
SQL Reference
AGE does not support embedding SQL statements directly within Cypher queries. However, you can define SQL functions and invoke them from within Cypher commands using user-defined functions.
Note!
OnlyVOIDand scalar-returning functions are supported. Functions returning sets (i.e.,SETOForTABLE) are not currently supported.
CREATE OR REPLACE FUNCTION public.get_event_year(name agtype) RETURNS agtype AS $$
SELECT year::agtype
FROM history AS h
WHERE h.event_name = name::text
LIMIT 1;
$$ LANGUAGE sql;
SELECT * FROM cypher('graph_name', $$
MATCH (e:event)
WHERE e.year < public.get_event_year(e.name)
RETURN e.name
$$) AS (n agtype);
| name |
|---|
"Apache Con 2021" |
| (1 row) |