REGISTER
|
Search Tycoon Talk
|
Freelancer.com
|
Members
Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.
Register Here
Forum Rules
The Database Forum
You are currently viewing our The Database Forum as a guest. Please
register
to participate.
Login
Remember Me?
Login via Freelancer.com
Tycoon Talk
>
Web Administration Support
>
The Database Forum
>
SELECT the previous and next records
Link Back
Thread Tools
Search this Thread
SELECT the previous and next records
12-28-2006, 06:59 PM
#
1
(
permalink
)
SELECT the previous and next records
numbenator
Webmaster Talker
Posts: 516
Location: London
Trades:
0
Talkupation:
HI
Using a select, i want to select the next and previous records and the selected given a primary key = say 911
So , i want to pick up where topic_id = 911 3 records
the 911 record , previous and next
3 records
hope clear
cheers
__________________
Please login or register to view this content.
Registration is FREE
Register
now for full access!
12-31-2006, 12:31 PM
#
2
(
permalink
)
Re: SELECT the previous and next records
!!cuisinart
Novice Talker
Posts: 6
Name: !!cuisinart
Trades:
0
Talkupation:
Try using following query
Code:
SELECT * FROM tabelname WHERE id > (SELECT max(id) FROM tabelname WHERE id<911) ORDER BY id LIMIT 3
__________________
Please login or register to view this content.
Registration is FREE
12-31-2006, 03:16 PM
#
3
(
permalink
)
Re: SELECT the previous and next records
ADAM Web Design
Canadastaninianite
Latest Blog Post:
If You Hate Form Spam, This is the Site for You
Posts: 5,938
Name: Adam for web page design, not program
Location: Toronto, Ontario, Canada
Trades:
0
Talkupation:
The query itself won't do it, no matter how you format it.
You would basiclaly create your query to return all records (Select fields from table), then you'd use recordset paging to travers the records to get to where you wanted to get to.
__________________
Please login or register to view this content.
Registration is FREE
|
Please login or register to view this content.
Registration is FREE
(my blog)
Please login or register to view this content.
Registration is FREE
(with proof)
« Reply to
SELECT the previous and next records
Previous Thread
|
Next Thread
Tycoon Talk
>
Web Administration Support
>
The Database Forum
>
SELECT the previous and next records
Thread Tools
Search this Thread
Show Printable Version
Email this Page
Search this Thread
:
Advanced Search
Posting Rules
You
may not
post new threads
You
may not
post replies
You
may not
post attachments
You
may not
edit your posts
BB code
is
On
Smilies
are
On
[IMG]
code is
On
HTML code is
Off
Trackbacks
are
Off
Pingbacks
are
Off
Refbacks
are
Off
Forum Rules
Feeds:
RSS
JS
XML
Feeds for this forum:
RSS
JS
XML
LinkBack
LinkBack URL
About LinkBacks
Bookmark & Share
Digg this Thread!
Add Thread to del.icio.us
Bookmark in Technorati
Tweet this thread
Page generated in
0.12159
seconds with
12
queries