Cheers! Rick Ratchford ProfitMax Trading Inc. http://www.amazingaccuracy.com
#>-----Original Message----- #>From: sqlite-users-boun...@sqlite.org #>[mailto:sqlite-users-boun...@sqlite.org] On Behalf Of Igor Tandetnik #>Sent: Thursday, July 09, 2009 1:15 PM #>To: sqlite-users@sqlite.org #>Subject: Re: [sqlite] SQL Syntax #> #>Rick Ratchford <r...@amazingaccuracy.com> #>wrote: #>> select #>> (select min(Year) ...) as firstFullYear, #>> (select max(Year) ...) as lastFullYear; #>> #>> If I go with the condensed version you illustrate above, I #>assume that #>> I would then need to use the LIMIT clause, right? When I #>tried it, I #>> get a bunch of rows returned, all with the same information. #>> #>> 1988 2008 #>> 1988 2008 #>> 1988 2008 #>> 1988 2008 #>> 1988 2008 #>> 1988 2008 #>> ... #>> #>> Here is the SQL used: #>> #>> Select (Select min(Year) From TmpTable Where Month=1 and Day<8) as #>> FirstYear, #>> (Select max(Year) From TmpTable Where Month=12 and Day>24) as #>> LastYear FROM TmpTable" #> #>Do you see a FROM clause in my example? #> #>Igor Tandetnik #> select (select min(Year) ...) as firstFullYear, (select max(Year) ...) as lastFullYear; When I saw the '...', I assumed this was just a partial example and that I was to fill in the rest. Because I'm still a real newbie at this, I didn't realize that a 'select' does not always need to be followed by a table name. I feel like a real dummy now. :-& Thanks again. Rick _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users