很多人用不同的东西来解决易语言难题,咱也凑个热闹。如果用存储过程的话,和一般的编程语言也就雷同了,这里就用SQL的思想,在MySQL中实现一次。 MySQL drop table if exists n1;create temporary table n1(num int (1));insert into n1 values(1), (2), (3)
很多人用不同的东西来解决易语言难题,咱也凑个热闹。如果用存储过程的话,和一般的编程语言也就雷同了,这里就用SQL的思想,在MySQL中实现一次。
MySQL
drop table if exists n1;
create temporary table n1(num int (1));
insert into n1 values(1), (2), (3), (4), (5), (6), (7), (8), (9);
drop table if exists n2;
create temporary table n2
select * from n1;
drop table if exists n3;
create temporary table n3
select * from n1;
drop table if exists nums1;
create temporary table nums1
select n1.num * 100 + n2.num * 10 + n3.num as num
from n1 left join n2
on n1.num <> n2.num
left join n3
on n1.num <> n3.num and n2.num <> n