[GENERAL] Copy row from table to table

2004-12-14 Thread Kall, Bruce A.
What is the easiest way to copy a particular row from one table to another (assuming all the columns are exactly the same). I want to maintain a table ('backup_table') that has rows I have (or will be) deleting from my 'original_table'. (Both tables have the same 68 columns). I've tried INSERT

Re: [GENERAL] SELECTing on age

2004-12-13 Thread Kall, Bruce A.
I'm attempting to select records from my postgresql database using php based on whether someone is at least 17 years old on the date of a particular visit. My sql is: $db_sql = SELECT * from list WHERE ((visit_date - birth_date) = 17)' $db_result = db_exec($db_sql) $num =

[GENERAL] SELECT duplicates in a table

2004-11-22 Thread Kall, Bruce A.
I've look for a solution to this, but have only been able to find solutions to delete duplicate entries in a table by deleting entries not returned by SELECT DISTINCT. What sql should I use to SELECT entries in a table that have two particular column values that match? For example, my_table

Re: [GENERAL] SELECT duplicates in a table

2004-11-22 Thread Kall, Bruce A.
Thanks. Worked like a charm! Bruce [EMAIL PROTECTED] wrote: Try SELECT * FROM mytable WHERE (identification_number,date_of_birth) IN (SELECT identification_number , date_of_birth FROM mytable m2 GROUP BY identification_number,data_of_birth