我的表格中包含;WITH CTE AS (
SELECT top 1000 * FROM test WHERE order_num IN(
select order_num
FROM test
WHERE TO_DATE (mod_dt) BETWEEN TO_DATE ('11-JUN-15') AND TO_DATE ('17-JUL-15')
AND REGION = 'AK') )
delete *
from CTE;
,to
和from
列。我只需要选择每{10} ID
ID
到A
的行。
答案 0 :(得分:4)
select * from
(select * from table where from = 'A' and to ='B' order by ID)
where mod(rownum/10,1) = 0
首先只需要来自' A'到' B'然后给他们rownums,并且只选择那些在ETC第10个地方的那些..
答案 1 :(得分:-1)
或者您可以使用
select from, to, id
from table1
where id like'%0' and from ='A' and to = 'B'