Options
- Subscribe to RSS Feed
- Mark Question as New
- Mark Question as Read
- Float this Question for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Hive query to find Total count of records and count(lastrundate) records
Labels:
- Labels:
-
Apache Hive
Rising Star
Created ‎05-15-2019 02:13 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I need to get output like total-count-of-records-InTable, count(max(date)) using Hive.
Where count(max(date)) ----> gives the count of records loaded from last run. Each record has current-run-date column.
I know to get both separately, but not sure to get the output together...
Could anyone help me on this...
Appreciate your help..
Thanks,
Jee
1 REPLY 1
Master Guru
Created ‎05-16-2019 04:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try with the below queries:
select count(*) from <db>.<tab_name> where date in (select max(date) from <db>.<tab_name> --get max date from table)
(or)
select count(*) from <db>.<tab_name> where date = (select max(date) from <db>.<tab_name>)
