Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register


2
(click on this box to dismiss)

What is the best way to "SELECT FROM DUAL" in CUBRID?

I have found some korean forum references telling me that I could use db_root instead of dual, but I'm not sure if that's correct... I'm looking for a syntax-trick to allow for queries like

SELECT 1 WHERE 1 = 1


In some databases, the above syntax is already correct. In other databases, there is a dummy table called DUAL, which I can put to make the syntax work:

SELECT 1 FROM DUAL WHERE 1 = 1


What's the best thing to do in CUBRID? Currently, I've come up with this solution here (which I'm also using in jOOQ's Ingres integration):

SELECT 1 FROM (SELECT 1 AS DUAL) AS DUAL WHERE 1 = 1
link comment (0) accepted answer
asked 2 years ago
lukaseder
63
47 Answers
2

The first query will not work. But the simpler solution will do.

SELECT 1;

But also you can use db_root like you saw in the Korean forum.

SELECT 1 FROM db_root WHERE 1=1

link comment (1)
answered 2 years ago
dba
558
tagged




You are either using a very old browser or a browser that is not supported.
In order to browse cubrid.org you need to have one of the following browsers:



Internet Explorer: Mozilla Firefox: Google Chrome: