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.
|