Hi Bob,
> I need to perform a "select next" query
> where I have the current record
> ID, and need to reference the next ID in
> the database for navigational
> purposes. (i.e., click a link to open the
> next record).
Here you go:
CREATE TABLE ky_cust (
cust_id NUMBER(*,0),
cust_name VARCHAR2(254)
);
INSERT INTO ky_cust VALUES (10,'bob');
INSERT INTO ky_cust VALUES (22,'tom');
INSERT INTO ky_cust VALUES (33,'joe');
INSERT INTO ky_cust VALUES (42,'sam');
INSERT INTO ky_cust VALUES (56,'tim');
INSERT INTO ky_cust VALUES (69,'sue');
COMMIT;
SELECT cust_id, cust_name
FROM (SELECT cust_id, cust_name, ROWNUM rn
FROM ky_cust
WHERE cust_id > 10) inn
WHERE inn.rn = 1
Cheers,
Keith.
--- In [email protected], Bob Sawyer <[EMAIL PROTECTED]> wrote:
> I need to perform a "select next" query where I have the current record
> ID, and need to reference the next ID in the database for navigational
> purposes. (i.e., click a link to open the next record).
>
> I googled "select next" + Oracle but didn't get anything useful. So,
> unsure of how to do this, I tried reopening the current record, then
> selecting next:
>
> "select * from customer where cust_id = '$u'"; // $u == current record
> "select next from customer";
>
> I also tried:
>
> "select next from customer where cust_id = '$u'";
>
> to no avail.
>
> What's the proper syntax here?
>
> Thanks,
> -Bob
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Take Yahoo! Mail with you! Get it on your mobile phone.
> http://mobile.yahoo.com/maildemo
Community email addresses:
Post message: [email protected]
Subscribe: [EMAIL PROTECTED]
Unsubscribe: [EMAIL PROTECTED]
List owner: [EMAIL PROTECTED]
Shortcut URL to this page:
http://groups.yahoo.com/group/php-list
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php-list/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/