step2

Published: (December 3, 2025 at 03:45 PM EST)
1 min read
Source: Dev.to

Source: Dev.to

Example Query

-- Test just ONE table to see if anything works
-- Replace 'YOUR_TABLE' with an actual table name from your 45 columns

SELECT 
  'Test on: ' || table_name as test,
  (SELECT COUNT(*) FROM user_tables WHERE table_name = 'YOUR_TABLE') as stats_count,
  (SELECT COUNT(*) FROM "YOUR_TABLE") as actual_count,
  (SELECT COUNT(*) FROM "YOUR_TABLE" WHERE INTERNTIMESTAMP >= SYSDATE - 45) as recent_count,
  (SELECT MIN(INTERNTIMESTAMP) FROM "YOUR_TABLE") as oldest,
  (SELECT MAX(INTERNTIMESTAMP) FROM "YOUR_TABLE") as newest
FROM DUAL;
Back to Blog

Related posts

Read more »

Oracle Merge Into

!Forem Logohttps://media2.dev.to/dynamic/image/width=65,height=,fit=scale-down,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%...

compare3

sql SELECT 'ONLY_IN_US_1' AS location, t1.table_name FROM dba_tables t1 LEFT JOIN dba_tables t2 ON t1.table_name = t2.table_name AND t2.owner = 'GL...

compare2

sql SELECT CASE WHEN t1.table_name IS NOT NULL AND t2.table_name IS NULL THEN 'ONLY_IN_US_1' WHEN t2.table_name IS NOT NULL AND...

PostgreSQL Log Viewing

!Forem Logohttps://media2.dev.to/dynamic/image/width=65,height=,fit=scale-down,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%...