Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 78951 invoked from network); 24 Feb 2006 15:58:48 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 24 Feb 2006 15:58:48 -0000 Received: (qmail 74987 invoked by uid 500); 24 Feb 2006 15:58:40 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 74922 invoked by uid 500); 24 Feb 2006 15:58:39 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 74898 invoked by uid 99); 24 Feb 2006 15:58:39 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 24 Feb 2006 07:58:39 -0800 X-ASF-Spam-Status: No, hits=1.6 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_WHOIS,FROM_HAS_ULINE_NUMS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [66.163.179.96] (HELO web35302.mail.mud.yahoo.com) (66.163.179.96) by apache.org (qpsmtpd/0.29) with SMTP; Fri, 24 Feb 2006 07:58:36 -0800 Received: (qmail 17346 invoked by uid 60001); 24 Feb 2006 15:58:16 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=q63f6Ye+oSGISVW4g1EtLrXynPhHD7Un1x4gggi5xv5RflaPa3fPUa1P0EWtzAimFqdEGPBbDJKqCb++qEqyJxn+CusFa+xqSMBU3rLE/0RItlhB/q+6TW4s2LEOuDCg1+xAFgCycKjb79wcLumGb6RjGsspi5145OH5oR4hxvE= ; Message-ID: <20060224155816.17344.qmail@web35302.mail.mud.yahoo.com> Received: from [192.77.198.12] by web35302.mail.mud.yahoo.com via HTTP; Fri, 24 Feb 2006 07:58:16 PST Date: Fri, 24 Feb 2006 07:58:16 -0800 (PST) From: Ashish Kulkarni Subject: [OT] Need help with SQL Query To: user-java@ibatis.apache.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Hi I have a table with 4 columns number, name, date, time, it is not unique so can have multiple entries for one name at different date and time. I need to find out the first instance of name for that number in this table, or get the name with minimum date and time i can do select min(date), min(time) from mytable where number=123 this will give me the min date and time , but how can i get the name also, for example select min(date), min(time), name from mytable number=123 wont work Ashish __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com