How to view if a table has been read recently in postgres 12 - postgresql-12

How can I manage to view if a table has been read recently in postgresql 12 ?
I will need something like "select lastdateread from stat_table"

Related

Formula is changed when Google form update sheet

I have created a Google Form. Data submitted through this form is automatically saved to an associated worksheet named "Answers". In the same document, I created a new sheet named "Presentation" for data presentation.
Data from "Answers" is imported 1: 1 using reference =(Answers!A1)
When a new entry is added from the form, it correctly appears at the end of the list on "Answers". Unfortunately, at the same time, the addressing in the "Presentation" spreadsheet changes by itself, as if the row had been deleted or something.
More details:
Content of 5 rows and 3 columns in "Presentation" looks like:
1 =(Answers!A2) =(Answers!B2)
2 =(Answers!A3) =(Answers!B3)
3 =(Answers!A4) =(Answers!B4)
4 =(Answers!A5) =(Answers!B5)
5 =(Answers!A6) =(Answers!B6)
When the third form is sent addressing in "Presentation" is changing by itself and looks like this:
1 =(Answers!A2) =(Answers!B2)
2 =(Answers!A3) =(Answers!B3)
3 =(Answers!A5) =(Answers!B5)
4 =(Answers!A6) =(Answers!B6)
5 =(Answers!A7) =(Answers!B7)
Then of course I can't see the value on line 3 of "Answers". If I send another form, it is like this:
1 =(Answers!A2) =(Answers!B2)
2 =(Answers!A3) =(Answers!B3)
3 =(Answers!A6) =(Answers!B6)
4 =(Answers!A7) =(Answers!B7)
5 =(Answers!A8) =(Answers!B8)
I have no idea where the error is or why it is. Do you have any ideas?
Use arrayformula in Presentation's tab. Put in row#1
={"title of column";arrayformula(Answers!A2:A)}

How to combine content from several tables into one?

this is the first time I'm posting here.
I'm trying to make a spreadsheet for my work on Google Sheets and I want to make a table with all the information from 5 other tables without having to copy and paste it.
I have 5 tables, all of them have the same number of columns and the same type of data in each column.
I need to make a new table that shows all the data from all the tables in one.
To make it simpler let's suppose I have 3 tables A, B and C
Each of the tables are like this:
Table A:
DATE|DESCRIPTION|PRICE
1/10|AAAAAAAAAAA|10000
2/10|BBBBBBBBBBB|20000
3/10|CCCCCCCCCCC|30000
Table B:
DATE|DESCRIPTION|PRICE
4/10|DDDDDDDDDDD|40000
5/10|EEEEEEEEEEE|50000
6/10|FFFFFFFFFFF|60000
Table C:
DATE|DESCRIPTION|PRICE
7/10|GGGGGGGGGGG|70000
8/10|HHHHHHHHHHH|80000
9/10|IIIIIIIIIII|90000
I would like to make a table D with the information from tables A, B and C like this:
Table D:
DATE|DESCRIPTION|PRICE
1/10|AAAAAAAAAAA|10000
2/10|BBBBBBBBBBB|20000
3/10|CCCCCCCCCCC|30000
4/10|DDDDDDDDDDD|40000
5/10|EEEEEEEEEEE|50000
6/10|FFFFFFFFFFF|60000
7/10|GGGGGGGGGGG|70000
8/10|HHHHHHHHHHH|80000
9/10|IIIIIIIIIII|90000
Also if I add one more row in any of the tables I want table D to update as well automatically either by adding the new row at the end or in another position... It doesnt really matter as long as it appears in table D.
How can I do this with a formula without having to copy and paste it?
Thank you so much!
Use query() with an { array expression }, like this:
=query(
{
Sheet1!A1:C;
Sheet2!A2:C;
Sheet3!A2:C
},
"where Col1 is not null",
1
)
You can use query for that
=QUERY({Sheet1!A2:C; Sheet2!A2:C; Sheet3!A2:C},"Select * where Col1 is not Null",0)
Please note while combining array, make sure to use similar range reference, that means row and column size of each array reference should be same otherwise it will throw Reference Error
Reference
Query

Is possible join paths in one query of AWS Athena?

Be studying use Athena in my project, but i dont't found possiblity of join folders in one request of Athena.
Example
i have datalog in folders day1 and day2, and i my query i need get data of both folders. In unique query! it's possible?
A table in Amazon Athena points to one folder in Amazon S3.
Therefore, you could:
Create a table for day1
Create a table for day2
CREATE VIEW days AS SELECT * FROM day1 UNION ALL SELECT * FROM day2
SELECT col1, col2 FROM days
The View will act as the combined table for day1 and day2.

OLEDB not reading all rows from XLSX under Windows 10 and Microsoft office 2013

I have XLSX file with 243k rows.
Same program gives different result on diffrent computers.
If i open it on Windows 8.1 + Office 2010, program reads all of 243k Rows and all works fine.
Under Windows 10+Office 2013 it reads only first 237k Rows, truncating last 6k rows.
Im using Delphi, with following connection string
ADOConnection1.ConnectionString:='Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\File.xlsx;Extended Properties="Excel 12.0;HDR=NO;IMEX=1"';
ADOQuery1.SQL.Text:='SELECT * FROM Sheet1$'
ADOQuery1.Open;
ShowMessage(ADOQuery1.RecordCount.ToString);
Problem was with table indexies and i messed up with code a bit.
Query text was taking first table name from table list instead of constant.
ADOQuery1.SQL.Text:='SELECT * FROM '
However, table indexes are different from version to version.
So selection was from different tables
Windows 8.1+Office2010 table list:
_xlnm#_FilterDatabase
_xlnm#Database
_xlnm#Print_Area
Instruction$
CATALOG$
Windows 10+Office2013 table list
_xlnm#Database
Instruction$
Instruction$_xlnm#Print_Area
CATALOG$
CATALOG$_xlnm#_FilterDatabase
But if i open file in Excel, there are only 2 sheets named : "Instruction" and "Catalog".
I dont know where the 237k rows are came from.

More complex charting in Google Spreadsheet

I've got data that looks something like this:
Campaign Date Clicks
EmailA 14/08/01 20
EmailB 14/08/01 10
EmailC 14/08/01 5
EmailA 14/08/02 15
EmailB 14/08/02 7
EmailC 14/08/02 3
EmailA 14/08/03 10
EmailB 14/08/03 5
EmailC 14/08/03 1
I'd like to be able to set up a Google Spreadsheet chart to draw a line for each campaign, with the clicks charted out over time.
However, I've got to do this with lots of data, so manually adjusting the data (besides changing sorting) isn't really an option. And I don't want to have to manually define data ranges.
Is this possible? I know Google Spreadsheets isn't as complex as Excel, but I'm hoping this is doable.
Thanks for your help!
You can create a new table using QUERY (this will dynamically update as the source data changes):
=QUERY(A:C,"select B, sum(C) where B is not null group by B pivot A",1)
This pivots the data on the campaigns, and should facilitate charting the three series.

Resources