Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > Oracle
|
Oracle General Oracle database discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Oracle section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 17th, 2003, 04:42 AM
Registered User
 
Join Date: Sep 2003
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Desc order problem

Suppose my database has 50 records and my query is as:

select distinct(l.sno), c1.cname source, c2.cname dest, c3.cname protocol, l.dest_port
from Log l, Objects o1, Component c1, Objects o2, Component c2, Services s, Component c3
where ((l.source_ip=o1.objlowip) and (c1.cid=o1.objid))
and ((l.dest_ip=o2.objlowip) and (c2.cid=o2.objid))
and (((l.dest_port=s.supp && slowp) and (l.protocol=s.protocol)) and (s.sid=c3.cid))
order by sno desc limit 2,10;

It will display the 10 records starting from last and leaving last 2. But if I want to display 10 records before sno=48 i.e. by specifying sno in my query. How can I modify my query i.e. how can I specify sno.







Similar Threads
Thread Thread Starter Forum Replies Last Post
Order by Desc Access 2007 mateenmohd Access 2 June 10th, 2008 09:11 AM
SQL "Order By" problem bear88 SQL Language 3 April 13th, 2005 10:45 AM
SQL "Order By" problem bear88 SQL Language 1 April 12th, 2005 12:18 AM
desc table miguel.ossa SQL Server 2000 2 February 26th, 2004 11:47 AM
MySQL query desc order problem dssachdeva MySQL 3 September 18th, 2003 01:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.