🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.interbase.sql
Article #710

Re: >=MAX(DATEFIELD)-15

#710
From: Craig Stuntz TeamB
Date: Fri, 27 Jul 2007 21:19
15 lines
1464 bytes
Serra wrote:

> SELECT * FROM ORDERS
> WHERE ODATE>=MAX(ODATE)-15

SELECT * FROM ORDERS
WHERE ODATE>=(SELECT MAX(ODATE) FROM ORDERS) -15

	If that's a performance problem (test on a big DB), use a proc.

-- 
Craig Stuntz [TeamB] � Vertex Systems Corp. � Columbus, OH
  Delphi/InterBase Weblog : http://blogs.teamb.com/craigstuntz
Useful articles about InterBase development:
  http://blogs.teamb.com/craigstuntz/category/21.aspx
Technical Details
Message-ID: <46aa6158$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <46aa5501$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 114a0e,ba742c0c4b5d7d8d
X-Google-Attributes: gid114a0e,public,usenet
X-Google-Language: ENGLISH,ASCII
From: "Craig Stuntz [TeamB]" <craig_stuntz@nospam.please [a.k.a. acm.org]>
Subject: Re: >=MAX(DATEFIELD)-15
Newsgroups: borland.public.interbase.sql
References: <46aa5501$1@newsgroups.borland.com>
Organization: Vertex Systems Corporation
User-Agent: XanaNews/1.18.1.5
X-Face: "huzh55Xi]!ZNni78>a*5+).`SK?<^q2MlHk-C]Z2M9T@\J5ZCB$95Ey+s"XQuhGFA[eutZ:0^AV!Q;t>gE`1-=8d;HZ6~*o1dH<X9\b$!|(}+I'!Xq)@3Op}%0ArW&nf'Qh*EwR
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
NNTP-Posting-Host: 24.106.104.205
Message-ID: <46aa6158$1@newsgroups.borland.com>
Date: 27 Jul 2007 14:19:20 -0700
X-Trace: newsgroups.borland.com 1185571160 24.106.104.205 (27 Jul 2007 14:19:20 -0700)
Lines: 15
X-Authenticated-User: cstuntz
Path: arc1-ca.pugleaf.net!g2news2.google.com!news1.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail