Auto Expand Table when source change - auto

I am using a table1 in Sheet1
I have created a second table2 in sheet2 that collects the data from table1 (not mirror).
I cant make table2 to autoexpand or vise versa when table1 is filled.
What Am I doing wrong?
Thank you!

Related

(PostgreSQL) Stored Procedure to move data from Table1 to Table 2

How would you move all the data in Table1 to Table2 on PostgreSQL using a stored procedure when Table1 and Table2 have different column names (cannot simply JOIN).
Assume both tables are already made in the DB and the purpose is once data from Table1 is moved to Table2, Table1 gets wiped (using a trigger?), and assume Table2 is blank before any data is moved from Table1.
Please refer to image below for a simplified example.
Was thinking using a cursor in some way or form. Would that be efficient?
Much thanks!
Click for image sample

SQL data migration

I'm just going to use an illustration to explain my problem. SQL Migration:
In the attached image are 2 SQL tables, Table 2 is referencing a primary key of table 1. Table 1 however had many duplicates so I deleted all the duplicates using Excel and imported the data into a new table with a new set of IDs. I now have to import table 2 into a new table and reference table 1 again like before. Now in the image it looks fairly easy to do that but I am dealing with a database of over 2000 rows after eliminating around 700 duplicates. Besides manually editing each row and matching them is there any way of doing this quickly. This is the first time I doing database migration but guessing there a quick ways of doing this. Google searches did not really bear any results. I appreciate any help on this.
To preview the data you need to delete from 2nd table please run this:
select * from names
where place_id NOT in (select id from places)
If you are happy with results you can run
delete from names
where place_id NOT in (select id from places)
after copying table2 into table2New
update table2New
set PlaceNameID = (select t1N.ID
from table2 as t2
join table1 as t1
on t1.ID = t2.PlaceNameID
join table1new as t1N
on t1.PlaceName = t1N.PlaceName
where table2New.ID = t2.ID
);

How to transfer data from one table to another randomly

Is it possible to put random values from table1.column1 (5rows) into table2.column2 (17 rows)?
What's more: column2 in table2 was added using alter table, so I have specific rows with ID and missing data only in that one added column.
example
image here

How to hide the parent table cell/row if child is hidden or having no data

I have table (t1) which is binded with some dataset. One of the row of this table is having another table (t2). so t2 is a child of t1. I want to hide row of t1 if there is no data in t2.
I tried setting the visibility expression of t2 as =CountRows() = 0. With this t2 is hidden but there is an empty space created.
I think I have to set the visibility of t1 row which is containing t2. I tried the same expression but it did not work.
Can anybody please tell me how to hide row of t1 if there is no data in t2. Or is there anyway to bind the visibility of t2 with row visibility of t1?
Atul
you can set expression in row visibility property of table (t1) like:
IIF(CountRows("Dataset1") > 0,true,false)

Is UPDATE without a JOIN possible?

I am trying to update a single column (all rows) from one table with a single value from another table. The problem is there is no index fields to join the tables on. Here is an example of the tables/columns in question (without data):
Table1: ID, Name, Address, Telephone, PriceList
Table2: PriceList, Description
I want to update Table1.Pricelist with the value in Table2.Pricelist
The current data I am testing with has one row in Table2 but it is possible for there to be more. In that case, I would just use the first value returned.
I thought I would post here to get the definitive answer as to whether this is possible.
update table1
set pricelist= (select top(1) table2.pricelist from table2);
UPDATE Table1
SET Pricelist = DLookup("PriceList", "Table2");
The DLookup expression will return a single value from Table2. So when Table2 contains only one row, it will give you the "first" PriceList value. However, with more rows in Table2, DLookup will still return one value but that may not come from the row which you consider to be the "first" row.
It would help to know how to identify which target row contains the PriceList value you want to use in the UPDATE.