生成序列(mysql没有函数生成序列,可以用下面语句生成序列)
select 1 as loli union select 2 as loli union select 3 as loli
把序列当成表搜索
select * from (select 1 as loli union select 2 as loli union select 3 as loli) as b;
拼表
select * from ((select 1 as num1) as a,(select 2 as num2) as b);
拿mysql数据库做拼表测试
select * from ((select user from user) as a,(select Db from db) b);
select * from ((select user from user) as a left join (select user,Db from db) b on a.user=b.user and b.db = 'mysql');
所有表必须有别名才能拼接
待补充
阅读(1395) | 评论(0) | 转发(0) |