How do I find the creator of a VIEW along with the timestamp?
Also, how do I find out last modifier name and timestamp for VIEW ?
use the following query; this will give you the information regrading timestamp:
describe extended <Table_name>;
Related
I don't mean a statement that has a starttime as a qualifier added.
Im interested to know if there is a way to find the date from when a user added a statement.
For example, Tiger Woods: Q10993
Through the revision history tab, you can see the date that a specific statement is added.
I wonder if it's possible to query this information.
I'm trying to get rid of this particular date filter on BQ and have a date column instead (kindly check the red circle to see what I'm talking about)
This data was extracted from Microsoft (Bing) Ads using Supermetrics. Any idea how to tackle this? Let me know if you need more information. Thank you.
AK
So the string depicted in the red circle is part of the table name i.e. 2021111.
So to view all the data you will want to create a query that looks at all the tables like, but be careful as datasets can get BIG fast.
SELECT *
FROM `BINGADS_AGE_GENDER_*`
If you wanted to only combine a certain date range you could use
SELECT *
FROM `BINGADS_AGE_GENDER_*`
WHERE _table_suffix BETWEEN '20211001' and '20211101'
If you use this datasource within datastudio you can use the #DS_START_DATE and #DS_END_DATE parameters with the date picker.
I have fir-ui-af***:firestore_export dataset in my BigQuery project.
In this dataset, I have speech_raw_changelog table and speech_raw_latest view.
This is schema of speech_raw_latest view.
In data field which I marked with a red pen, there is JSON data.
This is an example of field and value in data.
I would like to count the number of ******ka#gmail.com in email field in this speech_raw_latest view.
I searched the Internet and found that I should use COUNT function, but I don't know how to use it to solve my problem.
Could you give me any advice, please?
Below is for BigQuery Standard SQL
SELECT COUNTIF(JSON_EXTRACT_SCALAR(data, '$.email') = 'ka#gmail')
FROM `project.dataset.speech_raw_latest`
I've noticed that you can view the last modified date / time for a View inside of Microsoft Access, is there a way of getting this data out using standard SQL?
OK, I've managed to find the hidden table MSysObjects, this holds the Name of the object, along with DateCreated, DateUpdated and other useful information!
Context: I'm trying to INSERT data in a partitioned table. My table is partitioned by months, because I have lots of data (and a volume expected to increase) and the most recent data is more often queried. Any comment on the partition choice is welcome (but an answer to my question would be more than welcome).
The documentation has a partition example in which, when inserting a line, a trigger is called that checks the new data date and insert it accordingly in the right "child" table. It uses a sequence of IF and ELSIF statements, one for each month. The guy (or gal) maintaining this has to create a new table and update the trigger function every month.
I don't really like this solution. I want to code something that will work perfectly and that I won't need to update every now and then and that will outlive me and my grand-grand-children.
So I was wondering if I could make a trigger that would look like this:
INSERT INTO get_the_appropriate_table_name(NEW.date) VALUES (NEW.*);
Unfortunately all my attempts have failed. I tried using "regclass" stuffs but with no success.
In short, I want to make up a string and use it as a table name. Is that possible?
I was just about to write a trigger function using EXECUTE to insert into a table according to the date_parts of now(), or create it first if it should not exist .. when I found that somebody had already done that for us - right under the chapter of the docs you are referring to yourself:
http://www.postgresql.org/docs/9.0/interactive/ddl-partitioning.html
Scroll all the way down to user "User Comments". Laban Mwangi posted an example.
Update:
The /interactive branch of the Postgres manual has since been removed, links are redirected. So the comment I was referring to is gone. Look to these later, closely related answers for detailed instructions:
INSERT with dynamic table name in trigger function
Table name as a PostgreSQL function parameter
For partitioning, there are better solutions by now, like range partitioning in Postgres 10 or later. Example:
Better database for “keep always the 5 latest entries per ID and delete older”?