Skip to content

Instantly share code, notes, and snippets.

@bemasher
Created December 18, 2012 14:35
Show Gist options
  • Select an option

  • Save bemasher/4328506 to your computer and use it in GitHub Desktop.

Select an option

Save bemasher/4328506 to your computer and use it in GitHub Desktop.
Query for collecting id's of sequential character pairs matching a particular tuple of characters.
INSERT INTO Merge SELECT
a.SemanticID,
MIN(b.SemanticID)
FROM SubtitleSemantic a
JOIN SubtitleSemantic b ON
a.SemanticID < b.SemanticID
AND a.SubtitleID = b.SubtitleID
AND a.Line = b.Line
AND b.CharID = :second
WHERE a.CharID = :first
GROUP BY a.SemanticID
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment