brenagwynn: (Default)
[personal profile] brenagwynn
1. WITH data AS (SELECT 1 id, 2 amount FROM DUAL)
SELECT params.p1, data.id, SUM(data.amount)
FROM data, (SELECT :param p1 FROM DUAL) params
GROUP BY data.id

В 10м оракле такой запрос выполнится, в 11м выдаст ORA-00979: not a GROUP BY expression. 10й оракл понимает, что во внутреннем запросе будет всего одна строка, 11й этого не понимает.

2. WITH data AS (SELECT SYSDATE settlementdate, 2 amount, 3 accrualid FROM DUAL)
SELECT settlementdate, sum_amount
FROM ( SELECT settlementdate, SUM(amount) sum_amount, accrualid
FROM data
GROUP BY settlementdate)

В 10м оракле такой запрос выполнится, в 11м выдаст ORA-00979: not a GROUP BY expression. 10й оракл видит, что во внешнем запросе поле accrualid не используется, 11й этого не видит.
Хорошо это или плохо - не знаю.
From:
Anonymous( )Anonymous This account has disabled anonymous posting.
OpenID( )OpenID You can comment on this post while signed in with an account from many other sites, once you have confirmed your email address. Sign in using OpenID.
User
Account name:
Password:
If you don't have an account you can create one now.
Subject:
HTML doesn't work in the subject.

Message:

 
Notice: This account is set to log the IP addresses of everyone who comments.
Links will be displayed as unclickable URLs to help prevent spam.

Profile

brenagwynn: (Default)
brenagwynn

June 2011

S M T W T F S
   1234
5678 91011
12131415161718
192021 2223 2425
2627282930  

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 26th, 2017 12:35 pm
Powered by Dreamwidth Studios