Assuming no nulls, you GROUP BY the unique columns (eg. col_1, col_2, col_3), and SELECT the MIN (or MAX) Row ID (eg. row_id) as the row to keep. Then, delete everything that didn’t have a row id: DELETE my_table FROM my_table LEFT OUTER JOIN ( SELECT MIN(row_id) as row_id, col_1, ... Read more
Author Archives: Shiji Pan
About Oracle error “Cannot load OCI DLL”
When you use Oracle tools that call Oracle client dll “oci.dll”, you may meet this error. [caption id="attachment_1847" align="alignnone" width="366"] Cannot load OCI DLL[/caption] When you use these Withdata ... Read more
Batch replace string in WordPress posts
I want to change a link, from text link to image link, like: <a href=”abc.zip”>download</a> to <a href=”abc.zip”><img src=”/images/download.gif” alt=”download” /></a> And this link is not in one post, but some posts, it ... Read more
How to get column names from DB2 table
SELECT colname, typename, length, scale, default FROM syscat.columns WHERE tabname = “<table name>” AND tabschema = “<schema name>” See also: How to get column names from Sql Server table How to get column names from Oracle table How to get column names from ... Read more
How to get column names from Mysql table
We can use information_schema.columns for getting column information SELECT column_name FROM information_schema.columns WHERE table_schema = ‘My_Schema_Name’ AND table_name = ‘My_Table_Name’ See also: How to get column names from Sql Server table How to get column names ... Read more
How to get column names from Sql Server table
SELECT [name] AS [Column Name] FROM syscolumns WHERE id = (SELECT id FROM sysobjects WHERE type = ‘U’ AND [Name] = ‘My_Table_Name’) Type = ‘V’ for views Type = ‘U’ for tables For SQL Server 2008, we can use information_schema.columns for getting ... Read more
How to get column names from Oracle table
You can query the USER_TAB_COLUMNS table for table column metadata. SELECT table_name, column_name, data_type, data_length FROM USER_TAB_COLUMNS WHERE table_name = ‘My_Talbe_Name’ See also: How to get column names from Sql Server table How to get column names from DB2 table How to ... Read more
What is the dual table in Oracle
It’s a sort of dummy table with a single record used for selecting when you’re not actually interested in the data, but instead want the results of some system function in a select statement: e.g. select sysdate from dual; dual is a table which is created by oracle along with ... Read more
Withdata Software Released XlsToSql Version 2.3
Withdata software has announced xlstosql 2.3, a data conversion tool that import Excel data to ms SQL Server database. XlsToSql 2.3 add “Execute Sql from Command line”, add “Check Update” to menu, improve importing performance, and fix bug of exporting multiple sheets at ... Read more
Withdata Software Released XlsToOra Version 2.8
Withdata software has announced xlstoora 2.8, a data conversion tool that import Excel data to Oracle database. XlsToOra 2.8 add “Execute Sql from Command line”, add “Check Update” to menu, improve importing performance, and fix bug of exporting multiple sheets at one ... Read more