Created
December 11, 2014 14:34
-
-
Save Felienne/cc6ad6116bb4342c3fe0 to your computer and use it in GitHub Desktop.
SQL to Cypher
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
It was: | |
SELECT dbo.CellInRange.cellID, dbo.precedents_range.cellID as PrecID | |
FROM dbo.Cells as CellsInRange | |
INNER JOIN | |
dbo.precedents_range ON CellsInRange.Id = dbo.precedents_range.cellID | |
INNER JOIN | |
dbo.Range ON dbo.precedents_range.rangeID = dbo.Range.Id | |
INER JOIN | |
Dbo.CellInRange ON dbo.Range.Id = dbo.CellinRange.rangeID | |
UNION | |
SELECT dbo.Cells.Id as CellId, dbo.precedents.precId as PrecId | |
FROM dbo.Cells | |
INNER JOIN | |
dbo.precedents ON dbo.Cells.Id = dbo.precedents.cellId | |
INNER JOIN | |
Dbo.Cells as PrecedentsCells ON dbo.precedents.precId = precedentsCells.Id | |
Now it is: | |
Match (C:Cell) <- [*1..2] – (p:Cell) return c,p |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment