I came across this problem a while ago and not sure now why I couldn't do that. Maybe I needed to keep the column, but then I suppose I could do: select distinct col1, null as col2, coll3 from table
Maybe I needed the max or min from the ignore column and that works indeed fine with SR Neff's suggestion. RBS -----Original Message----- From: Dennis Cote [mailto:[EMAIL PROTECTED] Sent: 15 February 2007 23:01 To: [email protected] Subject: Re: [sqlite] SELECT DISTINCT but ignore one column? RB Smissaert wrote: > It sometimes would be very useful if you could do a SELECT DISTINCT, but > ignoring the data in one (or maybe more) particular column. > So for example > > col1 col2 col3 > ----------------- > A B C > A D C > > Then doing SELECT DISTINCT (IGNORE col2) * from table > would produce: > > A B C > > It wouldn't matter for me if it produced the above or > A D C > > But there could be rules/logic to that. > > Is this possible in SQLite or would it be possible to add this as a new > option? > > > > Why can't you simply do this? select distinct col1, col3 from table; If you don't care about the value returned for col2, why bother returning anything? Dennis Cote ---------------------------------------------------------------------------- - To unsubscribe, send email to [EMAIL PROTECTED] ---------------------------------------------------------------------------- - ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------

