Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

How to get records of last 15 days of [Tag_Id=96] ?

$
0
0

Hi,

The following query is working fine to get last records of [tag_id=96], but now i want to get last 15 days records

where [tag_id=96]?

How to get records of last 15 days of [Tag_Id=96] ?

I'm using Oracle 11g.

SQL = " select * From (select tag_id,TAG_VAL, row_number()over(partition by TAG_ID order by CLOCK DESC) rn from T_PP_OPC_INPUT s1 where (TAG_ID >= 96 ) ) a where rn='1'";

My table structure following.
RUN_ID    STRING
TAG_VAL   STRING
TAG_ID    STRING
CLOCK     CLOCK

your early reply would be appreciable..

thanks in advance.




Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>