Tag Info

New answers tagged


--======================================================= -- delete the duplicate records from table @t -- keeping a single unit of each -- marcelo miorelli 24-nov-2014 --======================================================= --======================================================= --create a table variable and insert records in it -- just for this ...


select ROW_NUMBER() OVER (PARTITION BY num, com ORDER BY identity_field) as 'RowNumber', t1.* into ##TableA from TableA t1 --delete t1 select t1.* from TableA t1 join ##TableA t2 on t2.identity_field=t1.identity_field where t2.RowNumber > 1 but first make backup of your table


you can make use of the so called ctid (which is basically an internal thing but for a lousy hack it should do. here is an example: ' test=# CREATE TABLE x (id int); CREATE TABLE test=# INSERT INTO x SELECT * FROM generate_series(1, 4); INSERT 0 4 test=# INSERT INTO x SELECT * FROM generate_series(1, 4); INSERT 0 4 test=# SELECT ctid, * FROM x; ctid | id ...


PostgreSQL has functions for regular expressions. PostgreSQL string functions So you can write triggers (function + dml event) to be done what you need. I don't believe it has some optimizer that compress strings across the records. Or maybe I didn't understand what you mean in the question.


If I understand your dilemma correctly, you have: Two tables, each of which can have a comment One of the tables is optional, i.e. it may not have an entry to correspond to the other For the second table, the comment is also optional, such that even if the second table has a record to match the first, the comment in the second may just "default" to a copy ...


You may want to normalize out the comments field to allow for a comments chain. This may have additional fields such as userid and date. This might result in a table tracking actions on issues. If this is not part of your design, I wouldn't normalize the comments field out. It appears you have an optional 1-1 relationship between the status checks and ...


I can see that this question has been here a few days and no one has taken a stab at it yet. I'm not familiar with mySQL so I can't give you a sample that will work, but here is an idea for you. Add another column to your table with a hash of the two teamID's. You will need to take care that the teams are entered in the same order, say ascending by their ...

Top 50 recent answers are included