Re: [SQL] Diffcult query

2003-03-21 Thread Josh Berkus
Dan, > Hi folks. This is giving me fits. I feel like it oughta be simple, but > apparantly its not...I think. > I need a ( preferably single ) query that will sum the costs for all unique > pairs of codes, without regard to column order. That is, for summing > purposes, rows 1 and 3 are identical

[SQL] Diffcult query

2003-03-21 Thread Dan Winslow
Hi folks. This is giving me fits. I feel like it oughta be simple, but apparantly its not...I think. Given a table : create table tablea ( code1 varchar(32), code2 varchar(32), costint ); and the rows code1code2cost -- "aaa""bbb"2 "d