A/B/C/D/E五个人互相传球

Posted moqingtong

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了A/B/C/D/E五个人互相传球相关的知识,希望对你有一定的参考价值。

A/B/C/D/E五个人互相传球

 

WITH a AS(
SELECT ‘a‘ a FROM dual UNION ALL SELECT ‘b‘ a FROM dual UNION ALL
SELECT ‘c‘ a FROM dual UNION ALL SELECT ‘d‘ a FROM dual UNION ALL
SELECT ‘e‘ a FROM dual)
,a1 AS(
SELECT a.a a ,a1.a a1
FROM a a ,a a1
WHERE a.a=‘a‘ AND NOT (a.a=a1.a) AND NOT (a.a=‘a‘ AND a1.a=‘b‘)
AND NOT (a.a=‘b‘ AND a1.a=‘a‘))
,a2 AS(
SELECT a1.* ,a.a a2
FROM a1 ,a
WHERE NOT (a.a=a1.a1) AND NOT (a.a=‘a‘ AND a1.a1=‘b‘) AND NOT (a.a=‘b‘ AND a1.a1=‘a‘)
AND NOT (a.a<>‘d‘ AND a1.a1=‘c‘) AND NOT (a.a=‘c‘ AND a1.a1=‘e‘))
,a3 AS(
SELECT a2.* ,a.a a3
FROM a2 FULL JOIN a ON 1 = 1
WHERE NOT (a.a=a2.a2) AND NOT (a.a=‘a‘ AND a2.a2=‘b‘) AND NOT (a.a=‘b‘ AND a2.a2=‘a‘)
AND NOT (a.a<>‘d‘ AND a2.a2=‘c‘) AND NOT (a.a=‘c‘ AND a2.a2=‘e‘))
,a4 AS(
SELECT a3.* ,a.a a4
FROM a3 ,a
WHERE NOT (a.a=a3.a3) AND NOT (a.a=‘a‘ AND a3.a3=‘b‘) AND NOT (a.a=‘b‘ AND a3.a3=‘a‘)
AND NOT (a.a<>‘d‘ AND a3.a3=‘c‘) AND NOT (a.a=‘c‘ AND a3.a3=‘e‘))
SELECT *
FROM a4
WHERE a4.a4 NOT IN (‘b‘,‘a‘,‘c‘)
;




























以上是关于A/B/C/D/E五个人互相传球的主要内容,如果未能解决你的问题,请参考以下文章

PHP 简介

使用JdbcTemplate和JdbcDaoSupport

HTML常用标签

vue+vuex+axios从webpack-server获取模拟数据存入vuex并取回展示到页面

对称加密算法和非对称加密算法

最小生成树Kruskal算法(邻接矩阵和邻接表)