By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
448,784 Members | 1,182 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 448,784 IT Pros & Developers. It's quick & easy.

OT - ORACLE

P: n/a
i know i know...just get over it. look at the date of the last post/response
in an oracle ng. :)

this is a mysql specific query. i want to do the same thing in oracle. i
don't know how. the following gives a dynamic/unique id number to a set of
selected records. it kind of mimics RANK() in oracle. it's based on a
cartesian...anyway, if anyone can fill me in on a similar oracle translation
to this mysql query, i'd just about break down and cry from joi.

tia

=============

SELECT @id := @id + 1 Id ,
Value
FROM
(
SELECT @id := 0
) uniqueId ,
(
SELECT 'ABC' Value
UNION
SELECT 'DEF' Value
UNION
SELECT 'GHI' Value
) pseudoTable
Nov 15 '07 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Steve wrote:
i know i know...just get over it. look at the date of the last post/response
in an oracle ng. :)

this is a mysql specific query. i want to do the same thing in oracle. i
don't know how. the following gives a dynamic/unique id number to a set of
selected records. it kind of mimics RANK() in oracle. it's based on a
cartesian...anyway, if anyone can fill me in on a similar oracle translation
to this mysql query, i'd just about break down and cry from joi.

tia

=============

SELECT @id := @id + 1 Id ,
Value
FROM
(
SELECT @id := 0
) uniqueId ,
(
SELECT 'ABC' Value
UNION
SELECT 'DEF' Value
UNION
SELECT 'GHI' Value
) pseudoTable
Steve,

comp.databases.oracle.server seems to have quite a bit of traffic.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Nov 15 '07 #2

P: n/a

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:67******************************@comcast.com. ..
Steve wrote:
>i know i know...just get over it. look at the date of the last
post/response in an oracle ng. :)

this is a mysql specific query. i want to do the same thing in oracle. i
don't know how. the following gives a dynamic/unique id number to a set
of selected records. it kind of mimics RANK() in oracle. it's based on a
cartesian...anyway, if anyone can fill me in on a similar oracle
translation to this mysql query, i'd just about break down and cry from
joi.

tia

=============

SELECT @id := @id + 1 Id ,
Value
FROM
(
SELECT @id := 0
) uniqueId ,
(
SELECT 'ABC' Value
UNION
SELECT 'DEF' Value
UNION
SELECT 'GHI' Value
) pseudoTable

Steve,

comp.databases.oracle.server seems to have quite a bit of traffic.
thanks jerry...i didn't see that one listed. i'll give it a shout.

thanks again.
Nov 15 '07 #3

P: n/a
Hi,

You could probably select rownum.

On Nov 15, 12:30 pm, "Steve" <no....@example.comwrote:
i know i know...just get over it. look at the date of the last post/response
in an oracle ng. :)

this is a mysql specific query. i want to do the same thing in oracle. i
don't know how. the following gives a dynamic/unique id number to a set of
selected records. it kind of mimics RANK() in oracle. it's based on a
cartesian...anyway, if anyone can fill me in on a similar oracle translation
to this mysql query, i'd just about break down and cry from joi.

tia

=============

SELECT @id := @id + 1 Id ,
Value
FROM
(
SELECT @id := 0
) uniqueId ,
(
SELECT 'ABC' Value
UNION
SELECT 'DEF' Value
UNION
SELECT 'GHI' Value
) pseudoTable
Nov 16 '07 #4

P: n/a

"petersprc" <pe*******@gmail.comwrote in message
news:5f**********************************@l1g2000h sa.googlegroups.com...
Hi,

You could probably select rownum.
damn it! you're right! i had tried rowid at first...i couldn't remember what
it was called. rowid, of course, is and alphanum result. rownum is exactly
it...and it worked.

thanks.
Nov 16 '07 #5

This discussion thread is closed

Replies have been disabled for this discussion.