一条SQL生成九九乘法表

简介: 导读:   with t as (select level as n from dual connect by level = b.
导读:
  with t as (select level as n from dual connect by level <=9)
  select sys_connect_by_path(b.n || '*' || a.n || '=' || a.n * b.n, ' ') as 九九乘法表
  from t a, t b
  where a.n >= b.n and level = a.n
  start with b.n=1
  connect by a.n=prior a.n and b.n=prior b.n+1;

本文转自
http://woodnan.itpub.net/post/37055/457860
相关文章
|
3月前
|
SQL 关系型数据库 MySQL
五、SQL常用函数
五、SQL常用函数
30 0
|
9月前
|
SQL
|
SQL Java 关系型数据库
SQL 写法:行行比较,别问为什么,问就是厉害
SQL 写法:行行比较,别问为什么,问就是厉害
SQL 写法:行行比较,别问为什么,问就是厉害
|
SQL 关系型数据库 MySQL
一句SQL,我有6种写法
最近在刷LeetCode中数据库题目时,有一道排名题目,用了6种写法分别代表6种SQL思维来实现,想想也算是有趣。
126 0
一句SQL,我有6种写法