From 158b36e51c8c2925d6c8af6e08380369d019378e Mon Sep 17 00:00:00 2001
From: TinWoodman92 <chrhodgden@gmail.com>
Date: Sat, 16 Dec 2023 06:18:44 -0600
Subject: Initial commit

---
 moves_out_2.sql | 12 ++++++++++++
 1 file changed, 12 insertions(+)
 create mode 100644 moves_out_2.sql

(limited to 'moves_out_2.sql')

diff --git a/moves_out_2.sql b/moves_out_2.sql
new file mode 100644
index 0000000..e6b2a39
--- /dev/null
+++ b/moves_out_2.sql
@@ -0,0 +1,12 @@
+SELECT DISTINCT cur_move_log.board AS cur_board, cur_move_log.move, move_log.board AS next_board
+FROM
+	(
+		SELECT game_log.*, move_log.*, move_log.turn_num + 2 AS next_turn_num 
+		FROM game_log INNER JOIN move_log ON game_log.game_id = move_log.game_id
+		WHERE move_log.board = :fen_board AND game_log.plr_X_name = :plr_name AND game_log.plr_X_color_int = :plr_color_int
+	) AS cur_move_log INNER JOIN move_log 
+		ON cur_move_log.game_id = move_log.game_id
+		AND cur_move_log.next_turn_num = move_log.turn_num
+ORDER BY
+	cur_move_log.move, next_board
+;
\ No newline at end of file
-- 
cgit v1.2.3

