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
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 .
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.
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.
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]’.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With