快速SQL过程的提示和技巧 [英] Tips and tricks for fast SQL procedures

查看:67
本文介绍了快速SQL过程的提示和技巧的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无耻的自我推销;-)
http://www-106.ibm.com/developerwork...dm-0501rielau/


我现在已经到了我的尽头"微型系列"围绕SQL程序。

如果有人对SQL相关主题的想法需要注意我都是

耳朵。

MERGE已经出现到目前为止几次....

还有别的吗?


干杯

Serge

-

Serge Rielau

DB2 SQL编译器开发

IBM多伦多实验室

Shameless self promotion ;-)
http://www-106.ibm.com/developerwork...dm-0501rielau/

I''ve now reached the end of my "mini-series" around SQL Procedures.
If anyone has ideas on SQL related topics that need illuination I''m all
ears.
MERGE has come up a couple times so far....
Anything else?

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab

推荐答案

" Serge Rielau" < SR ***** @ ca.ibm.com>一个écritdansle message de

新闻:35 ************* @ individual.net ...
"Serge Rielau" <sr*****@ca.ibm.com> a écrit dans le message de
news:35*************@individual.net...
无耻的自我推销; - )
http:// www-106.ibm.com/developerwork...dm-0501rielau/
我现在已经到了我的迷你系列的末尾。围绕SQL程序。
如果有人对SQL相关主题的想法需要注意我都是耳朵。
MERGE到目前为止已经出现过几次...... 其他什么?

干杯
Serge
-
Serge Rielau
DB2 SQL编译器开发
IBM多伦多实验室
Shameless self promotion ;-)
http://www-106.ibm.com/developerwork...dm-0501rielau/
I''ve now reached the end of my "mini-series" around SQL Procedures.
If anyone has ideas on SQL related topics that need illuination I''m all
ears.
MERGE has come up a couple times so far....
Anything else?

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab




嗨Serge,


GROUP BY ......有没有?


SQL92条款

SQL99子句

在DB2中最好做什么来处理Transact SQL就像(Sybase ...)


select type,title_id ,平均(价格),平均(推进)从标题组按类型

选择类型,title_id从标题组按类型有日期=最大(日期)


问候,


JM



Hi Serge,

GROUP BY ... HAVING ?

SQL92 clauses
SQL99 clauses
what is the best to do in DB2 to treat Transact SQL like (Sybase ...)

select type, title_id, avg(price), avg(advance) from titles group by type
select type, title_id from titles group by type having date=max(date)

Regards,

JM



Jean-Marc Blaise写道:
Jean-Marc Blaise wrote:
Serge Rielau < SR ***** @ ca.ibm.com> aécritdansle message de
新闻:35 ************* @ individual.net ...
"Serge Rielau" <sr*****@ca.ibm.com> a écrit dans le message de
news:35*************@individual.net...
无耻的自我推销; - )

http://www-106.ibm.com/developerwork...dm-0501rielau/
Shameless self promotion ;-)

http://www-106.ibm.com/developerwork...dm-0501rielau/
我现在已经到了我的迷你系列"围绕SQL程序。
如果有人对SQL相关主题的想法需要注意我都是耳朵。
MERGE到目前为止已经出现过几次...... 其他什么?

干杯
Serge
-
Serge Rielau
DB2 SQL编译器开发
IBM多伦多实验室
I''ve now reached the end of my "mini-series" around SQL Procedures.
If anyone has ideas on SQL related topics that need illuination I''m all
ears.
MERGE has come up a couple times so far....
Anything else?

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab



嗨Serge,

GROUP BY ......有没有?

SQL92条款
SQL99条款


Hi Serge,

GROUP BY ... HAVING ?

SQL92 clauses
SQL99 clauses



关于GROUP BY / HAVING?或者一般。

有关于SQL-92和SQL-99的全书;-)

在DB2中最好做什么来处理Transact SQL(Sybase。 ..)
不清楚你是什么意思?
选择类型,title_id,平均(价格),平均(推进)从标题组按类型选择类型,title_id从标题组按类型分类date = max(date)


With respect to GROUP BY/HAVING? or general.
There are whole books about SQL-92 and SQL-99 ;-)
what is the best to do in DB2 to treat Transact SQL like (Sybase ...) Not clear what you mean?
select type, title_id, avg(price), avg(advance) from titles group by type
select type, title_id from titles group by type having date=max(date)



这里都没有....除此之外你会在title_id上​​出错...


干杯

Serge


-

Serge Rielau

DB2 SQL编译器开发

IBM多伦多实验室


Neither here.... other than that you will get an error on title_id...

Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab


" Serge Rielau" < SR ***** @ ca.ibm.com>一个écritdansle message de

news:35 ************* @ individual.net ...
"Serge Rielau" <sr*****@ca.ibm.com> a écrit dans le message de
news:35*************@individual.net...
Jean-Marc Blaise写道:
Jean-Marc Blaise wrote:
" Serge Rielau" < SR ***** @ ca.ibm.com> aécritdansle message de
新闻:35 ************* @ individual.net ...
"Serge Rielau" <sr*****@ca.ibm.com> a écrit dans le message de
news:35*************@individual.net...
无耻的自我推销; - )

http://www-106.ibm.com/developerwork...dm-0501rielau/
Shameless self promotion ;-)

http://www-106.ibm.com/developerwork...dm-0501rielau/
我现在已经到了我的迷你系列的末尾。围绕SQL程序。
如果有人对SQL相关主题的想法需要注意我都是耳朵。
MERGE到目前为止已经出现过几次...... 其他什么?

干杯
Serge
-
Serge Rielau
DB2 SQL编译器开发
IBM多伦多实验室
I''ve now reached the end of my "mini-series" around SQL Procedures.
If anyone has ideas on SQL related topics that need illuination I''m all
ears.
MERGE has come up a couple times so far....
Anything else?

Cheers
Serge
--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab



嗨Serge,

GROUP BY ......有没有?

SQL92条款
SQL99条款


Hi Serge,

GROUP BY ... HAVING ?

SQL92 clauses
SQL99 clauses


尊重GROUP BY / HAVING?或者一般。
有关于SQL-92和SQL-99的全书; - )


With respect to GROUP BY/HAVING? or general.
There are whole books about SQL-92 and SQL-99 ;-)



==>关于GROUP BY / HAVING; - )


==> With respect to GROUP BY/HAVING ;-)

在DB2中最好做什么来处理Transact SQL就像(Sybase ...)不清楚你的意思?
what is the best to do in DB2 to treat Transact SQL like (Sybase ...) Not clear what you mean?



==>关于GROUP BY / HAVING模拟竞争对手的任何技巧?什么是转换为DB2的最佳方式?


==> Any tricks about GROUP BY/HAVING to simulate competitors ? What is the
best way to translate into DB2 ?


选择类型,title_id,avg(价格),avg(提前)来自标题组的
类型选择类型,title_id来自标题组按类型有日期=最大(日期)

select type, title_id, avg(price), avg(advance) from titles group by type select type, title_id from titles group by type having date=max(date)


这里都没有....除此之外你会得到一个错误title_id ...


Neither here.... other than that you will get an error on title_id...



==>在DB2上是,但在Sybase上没有。 MTK 1.3部分翻译,并说

title_id丢失。
干杯
Serge

-
Serge Rielau
DB2 SQL编译器开发
IBM多伦多实验室


==> Yes on DB2, but not on Sybase. The MTK 1.3 translates partially and says
title_id is missing.
Cheers
Serge

--
Serge Rielau
DB2 SQL Compiler Development
IBM Toronto Lab



这篇关于快速SQL过程的提示和技巧的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆