Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use of TABLE_DATE_RANGE function with table decorators

Is there any any way to use TABLE_DATE_RANGE or TABLE_QUERY with table decorators?

I would like to extract all "new records" (added in past 2 hours) from a set of tables.

Many thanks

like image 690
N.N. Avatar asked Mar 30 '14 05:03

N.N.


People also ask

What is the use of table_date_range function?

These functions are used in the FROM clause to match a collection of table names using one of several types of filters. For example, the TABLE_DATE_RANGE function can be used to query only a specific set of daily tables. For more information on these functions, see Table wildcard functions .

How to show the range of dates in PostgreSQL?

In Postgresql, there is no inbuilt function for showing a range of dates, but we will create our own function to show the range of dates. Let’s create a function named daterange that accepts two parameters in the form of string or varchar data type.

How do I use date and time functions in a query?

It's useful to use date and time functions to group query results into buckets corresponding to particular years, months, or days. The following example uses the UTC_USEC_TO_MONTH () function to display how many characters each Wikipedia contributor uses in their revision comments per month.

How to return the date range from a specific date to infinity?

In Postgresql, we can return the date range from a specific date to infinity using daterange. Let’s return the name of the person whose hiring date from a specific date to infinity. The above code will show the first_name of the person whose hiring dater from 1994-06-25 to infinity using ‘ [1994-06-25, infinity]’.


Video Answer


1 Answers

Not currently. That's an interesting feature request, however. I'm trying to think of what the syntax would look like. Perhaps where the dataset name / prefix is used we could use a *, as in TABLE_DATE_RANGE(dataset1.prefix*@time, timestamp1, timestamp2) or TABLE_QUERY(dataset1.prefix*@time, 'where clause')

I've filed a feature request.

like image 180
Jordan Tigani Avatar answered Nov 17 '22 00:11

Jordan Tigani