我想檢查一行中是否有四個相同的值(我的意思是一個接一個,而不是表中的一行)。所以,如果我檢查的價值「附件」,下面的查詢結果將是錯誤的:檢查一個查詢是否在MySQL中返回了4個連續的相同值
type_count post_type
1 post
2 attachment
3 post
4 post
5 attachment
6 post
7 attachment
8 post
9 post
10 post
11 post
12 attachment
13 post
14 post
15 post
鑑於此數據集將被證明是正確的:
type_count post_type
1 post
2 attachment
3 post
4 post
5 attachment
6 attachment
7 attachment
8 attachment
9 post
10 post
11 post
12 attachment
13 post
14 post
15 post
這可能嗎?從查詢結果而不是表格開始工作。
是遊標和存儲過程接受? – cantSleepNow
@cantSleepNow - 如果可能,寧願用查詢來做。 – BFWebAdmin