473,386 Members | 1,810 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Re: CTE CONVERSION TO DB2

Lennart wrote:
Apparently this restriction is no more:

[lelle@53dbd181 ~]$ db2 "with T0(n) as (values 1), T1(n,m) as (select
x.n, y.n from T0 x cross join T0 y) select * from T1"

N M
----------- -----------
1 1

Ignore my previous post
We added CROSS JOIN as a synonym for INNER JOIN ON 1=1 in DB2 9.5.
There are a pile of such "syntactic sugar" featurettes in DB2 9.5.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jun 27 '08 #1
5 2550
On May 13, 4:27 pm, Serge Rielau <srie...@ca.ibm.comwrote:
Lennart wrote:
Apparently this restriction is no more:
[lelle@53dbd181 ~]$ db2 "with T0(n) as (values 1), T1(n,m) as (select
x.n, y.n from T0 x cross join T0 y) select * from T1"
N M
----------- -----------
1 1
Ignore my previous post

We added CROSS JOIN as a synonym for INNER JOIN ON 1=1 in DB2 9.5.
There are a pile of such "syntactic sugar" featurettes in DB2 9.5.
Strange, I was pretty sure that you couldn't do:

with T0(n) as (values 1), T1(n,m) as (
select x.n, y.n from T0 x inner join T0 y on x.n = y.n
) select * from T1

in V8.2. I've verified that you can actually do it. Do you know when
this was allowed, 8.1 or 8.2 (I don't have a 8.1 installation to
test)? I'm pretty sure it was not allowed in V7. I'm just curious,
never had any need for anything but "," joins in CTE, hence never
tried it after V7.
/Lennart

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jun 27 '08 #2
Lennart wrote:
Strange, I was pretty sure that you couldn't do:

with T0(n) as (values 1), T1(n,m) as (
select x.n, y.n from T0 x inner join T0 y on x.n = y.n
) select * from T1

in V8.2. I've verified that you can actually do it. Do you know when
this was allowed, 8.1 or 8.2 (I don't have a 8.1 installation to
test)? I'm pretty sure it was not allowed in V7. I'm just curious,
never had any need for anything but "," joins in CTE, hence never
tried it after V7.
I'm pretty sure that syntax was valid in v7. In fact, I think it might
have been valid as far back as v5 (I'm fairly sure CTEs and VALUES were
in v5, along with INNER JOIN et al).
Cheers,

Dave.
Jun 27 '08 #3
On May 13, 6:32 pm, "Dave Hughes" <d...@waveform.plus.comwrote:
Lennart wrote:
Strange, I was pretty sure that you couldn't do:
with T0(n) as (values 1), T1(n,m) as (
select x.n, y.n from T0 x inner join T0 y on x.n = y.n
) select * from T1
in V8.2. I've verified that you can actually do it. Do you know when
this was allowed, 8.1 or 8.2 (I don't have a 8.1 installation to
test)? I'm pretty sure it was not allowed in V7. I'm just curious,
never had any need for anything but "," joins in CTE, hence never
tried it after V7.

I'm pretty sure that syntax was valid in v7. In fact, I think it might
have been valid as far back as v5 (I'm fairly sure CTEs and VALUES were
in v5, along with INNER JOIN et al).
Hmm, I realize blushing that I've probably mixed up the restrictions
on CTE and MQT refresh immediate. Sorry for any confusion I've caused
/Lennart

Jun 27 '08 #4
Lennart wrote:
Hmm, I realize blushing that I've probably mixed up the restrictions
on CTE and MQT refresh immediate. Sorry for any confusion I've caused
Actually I was about to point o RECURSIVE CTE restrictions.
There are some (overly severe) restrictions on join syntax in recursion.

Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
Jun 27 '08 #5
On May 13, 8:29 pm, Serge Rielau <srie...@ca.ibm.comwrote:
Lennart wrote:
Hmm, I realize blushing that I've probably mixed up the restrictions
on CTE and MQT refresh immediate. Sorry for any confusion I've caused

Actually I was about to point o RECURSIVE CTE restrictions.
There are some (overly severe) restrictions on join syntax in recursion.
Please do if you have it at hand. I remember vaguely that I started
thinking about what we could express with recursion in sql:

http://tinyurl.com/4fkdtn

but then my evil boss thought I had better things to do ... ;-)
/Lennart

Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Stub | last post by:
Docs says that "The compiler does not use an explicit constructor to implement an implied conversion of types. It's purpose is reserved explicitly for construction." I put up code of three cases...
7
by: Michael Lehn | last post by:
Hi, I have a question regarding the conversion of objects. When is the conversion done by the constructor and when by the operator. My feeling tells me that the constructor is preferred. But...
16
by: TTroy | last post by:
Hello, I'm relatively new to C and have gone through more than 4 books on it. None mentioned anything about integral promotion, arithmetic conversion, value preserving and unsigned preserving. ...
31
by: Bjørn Augestad | last post by:
Below is a program which converts a double to an integer in two different ways, giving me two different values for the int. The basic expression is 1.0 / (1.0 * 365.0) which should be 365, but one...
11
by: Steve Gough | last post by:
Could anyone please help me to understand what is happening here? The commented line produces an error, which is what I expected given that there is no conversion defined from type double to type...
2
by: Alex Sedow | last post by:
Why explicit conversion from SomeType* to IntPtr is not ambiguous (according to standart)? Example: // System.IntPtr class IntPtr { public static explicit System.IntPtr (int); public...
3
by: Steve Richter | last post by:
here is a warning I am getting in a C++ .NET compile: c:\SrNet\jury\JuryTest.cpp(55) : warning C4927: illegal conversion; more than one user-defined conversion has been implicitly applied while...
0
by: Lou Evart | last post by:
DOCUMENT CONVERSION SERVICES Softline International (SII) operates one of the industry's largest document and data conversion service bureaus. In the past year, SII converted over a million...
0
by: dataentryoffshore | last post by:
Get a Discount up to 60% on data entry, data capture, dataentry services, large volume data processing and data conversion services through offshore facilities in India. Offshore data entry also...
21
by: REH | last post by:
It it permissible to use the constructor style cast with primitives such as "unsigned long"? One of my compilers accepts this syntax, the other does not. The failing one chokes on the fact that the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.