#!/bin/bash # DR #4360 - Delete duplicate entries of children of taf_change_groups. PSQL="/awips2/psql/bin/psql" cmdDir=`dirname $0` # first argument is the table other arguments are columns to check for equal. function delDup { table=${1} shift col1=${1} shift cmd="select distinct t1.id" cmd="${cmd} from ${table} t1, ${table} t2 where t1.${col1}=t2.${col1}" for col in ${@} ; do cmd="${cmd} and t1.${col}=t2.${col}" done cmd="${cmd} and t2.id