I have a very large table in Teradata.
I have to run a UDF on a column and store the output of the UDF back in to the column.
We can do it in two ways
do a direct update of that column using the update query
create a staging table and select the rows with UDF applied and load the staging table. then delete all the rows from the original table and load the data back from the staging table.
Which is a better option performance-wise?
I have table full of data that I want to match up with a table from Oracle SQL Database. The table I have does not have all of the columns in the Database and has a smaller set of data. I just want a fairly simple way to check if the data can be matched up with a row in the Database.
I have two identical tables in the database (Same column name, same data type). Table A and Table B.
A is the master table. Now i want to update the table B with the changes done in the master table A automatically at any point of time. How would i do that without using DBMS_COMPARISON
I have a table that exists currently, and I want to add in a column from another table via a join. Is there a way to add it to this table and not have to create a new one? I know I could easily make another table with by joining the data in but I wasn't sure if there was a way to insert that kind of data to an existing one.
I am querying a vendors database that has data that is sharded between multiple tables. The tables are named Events_1, Events_2, Events_3, Events_4 etc.
It appears that a new table is automatically created when the table hits 10,000 records. I am looking to write a query that would be able union the results from all the tables (without having to manually add the tables as they are created) as well as a query to only look at the 2 newest tables.
Any suggestions on the best way to go about this?
The database is Microsoft SQL Server 2008
You can do this with dynamic SQL such that you query sysobjects for table name Events_* and build a SELECT UNION from the results.
Better, though perhaps more complicated, would be a DDL trigger that would dynamically update you UNION VIEW to append the new table whenever a table Events_* was created.