How would create a script to search all tables in a database to find columns that have similar formatted data and show which tables have columns with similar formatted data?
Pseudo code like this;
Requester to insert a column
script searches all tables and columns to find similar formatted data
Results shows like this
Column name | Table name |
If an example code is given with made up data, I should be able to figure it out. Thanks ahead of time!!!!
Related
I have 3 queries.
I need to join(merge) 2 columns in a table(there are 2 different columns in the table, need to merge them as one), kindly help with the syntax
I need to map accounts in a table but the issue being there is no unique identifier, the 2 columns are of same brand alcohol but the issue being the same alcohol has different name in different websites.
I am trying to move data from excel to snowflake but in few rows the data are of this format Meiomi Rosé, so the subsequent rows are not getting loaded and i tried to use REPLACE_INVALID_CHARACTERS 'True' but it is showing error.
Tried multiple syntaxt such as
alter table sales_ws merge SUPPLIER_VOLUME and VOLUME_UNITS;
alter table sales_ws 'join' (SUPPLIER_VOLUME, VOLUME_UNITS) AS Quantity;
tried to use REPLACE_INVALID_CHARACTERS 'True' within file format but did not work
I have 3 tables on mysqlworkbench, 1 table need to combine with 2 data ch(17million row) and cl(9million row) suppose to be one table, other table name alldoc.(121k)
Basically i need to combine ch and cl as one table, and compare with alldoc data. Technically they are suppose to be same but people made mistake that why i need to compare. 100 column
enter image description here
enter image description here
I plan to write query till i hit to 100 because i have 100 columns in all data. Just rows sizes are different.
Thank you from advance. I know complicated but i really need to compare these two data writing query
I have two tables with similar columns
Apply append, all details were ok except for the date of the new table.
Old data dates are available, but the new one is missing and specified as "null"
I check their format, both are the same
Anyone once knows what is the issue.
Below screenshot for reference
enter image description here
It's look like new table has different column name for date.
I'm in the process of formatting a database and have found a column I'd like to format. It has 3 types of information for every record in the column. For example, a record in my history column shows as (American, born Estonia. 19011974). What I want to do is put this data into new individual columns to make them atomic. I want to extract data such as 'American' into a country column, 'Estonia' into a born column and '1901' into a born column and '1974' into a death column. UPDATE: However, some of the columns hold nullls, for example, another record in the same column might be (German, 19242004), so a normal regular expression wouldn't work for all data would it? Any help is appreciated!
What PostgreSQL statements would I use to obtain specific parts of this data from the individual records? I understand it would be insert and have already came up with:
INSERT INTO historian (id,url)
SELECT object_id, url FROM maintable;
that statement allowed me to get those values into new columns, but those were atomic already so I could easily transition them. Thanks for any help! :)
My hql query in JRXML file takes out data rowwise from a table. From this data I need to display some records as columns based upon particular condition.
For example I get data as below:
Subtopic1_Down_1
Subtopic1_Down_2
Subtopic1_Up_1
Subtopic1_Up_2
Subtopic1_Up_3
Currently my jrxml helps me to display data one after another dividing the data with group expression = value of subtopic. All Subtopic1_Down records together in one table. Followed by Subtopic1_Up records in next table and so on for remaining subtopics.
Subtopic1_down
Subtopic1_down_1
Subtopic1_down_2
Subtopic1_Up
Subtopic1_Up_1
Subtopic1_Up_2
Subtopic1_Up_3
But now I want the data to be displayed in such a way that all Subtopic1_Down and Subtopic1_Up records should be displayed in table but different columns as below:
Subtopic1
Down Up
Subtopic1_Down_1 Subtopic1_Up_1
Subtopic1_Down_2 Subtopic1_Up_2
How can I achieve it through Jrxml?
You can make use of scriptlets to modify the resultset row-wise data into column at run time.