SQL Data Transfer And Aggregation Techniques
Copy data to new table with SQL: `SELECT a.* INTO newTable FROM oldTable a;` Use CAST for type conversion & count sum of multiple tables: `SELECT SUM(K) AS Total_Row_Count FROM (SELECT COUNT(*) FROM TABLE1 UNION SELECT COUNT(*) FROM TABLE2) A;
COPY ALL DATA TO NEW TABLE
SELECT a.* INTO newTable
FROM oldTable a;
CAST
CAST(columnName as VARCHAR)
CAST(columnName as INT)
COUNT SUM OF MULTIPLE TABLE
SELECT SUM(K) AS Total_Row_Count
FROM (
SELECT COUNT(*) FROM TABLE1
UNION
SELECT COUNT(*) FROM TABLE2
) A;