Al obtener el recuento de la tabla mediante la siguiente consulta
Select count(*)
from tab
where tdate = '17-05-19' ---> output 0
o
Select count(*)
from tab
where trunc(tdate) = '17-05-19' ---->output 0
Si uso:
Select count(*)
from tab
where tdate >sysdate - 1 ---> it returns some count(yesterday+some of the today txn)
Pero aquí solo quiero ayer txn cada vez que dispare esta consulta.
Pero aquí solo quiero ayer txn cada vez que dispare esta consulta.
Puedes usar esto.
Select count (*) from tab where
tdate >= TRUNC(SYSDATE) - 1
AND tdate < TRUNC(SYSDATE)
La ventaja de esto sobre el uso TRUNC
en la columna de fecha es que utilizará un índice si existe mástdate
Este artículo se recopila de Internet, indique la fuente cuando se vuelva a imprimir.
En caso de infracción, por favor [email protected] Eliminar
Déjame decir algunas palabras