Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

implementing last() or first() aggregate functions

3 posts in General Discussion Last posting was on 2005-04-17 12:56:56.0Z
hbrofman Posted on 2005-04-17 04:36:51.0Z
Sender: 248f.4261e756.1804289383@sybase.com
From: hbrofman
Newsgroups: ianywhere.public.general
Subject: implementing last() or first() aggregate functions
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4261e7e3.2493.1681692777@sybase.com>
NNTP-Posting-Host: 10.22.241.41
X-Original-NNTP-Posting-Host: 10.22.241.41
Date: 16 Apr 2005 21:36:51 -0700
X-Trace: forums-1-dub 1113712611 10.22.241.41 (16 Apr 2005 21:36:51 -0700)
X-Original-Trace: 16 Apr 2005 21:36:51 -0700, 10.22.241.41
Lines: 3
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4350
Article PK: 8167

since these are unsupported, does anyone know a way to
implement LAST() or FIRST() via a stored procedures or
function?


Greg Fenton Posted on 2005-04-17 12:04:10.0Z
From: Greg Fenton <greg.fenton_NOSPAM_@ianywhere.com>
Organization: iAnywhere Solutions Inc.
User-Agent: Mozilla Thunderbird 1.6.3.2f (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: ianywhere.public.general
Subject: Re: implementing last() or first() aggregate functions
References: <4261e7e3.2493.1681692777@sybase.com>
In-Reply-To: <4261e7e3.2493.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: cpec2cdc91b1d31-cm000f212f9e50.cpe.net.cable.rogers.com
X-Original-NNTP-Posting-Host: cpec2cdc91b1d31-cm000f212f9e50.cpe.net.cable.rogers.com
Message-ID: <426250ba$1@forums-1-dub>
Date: 17 Apr 2005 05:04:10 -0700
X-Trace: forums-1-dub 1113739450 69.198.107.137 (17 Apr 2005 05:04:10 -0700)
X-Original-Trace: 17 Apr 2005 05:04:10 -0700, cpec2cdc91b1d31-cm000f212f9e50.cpe.net.cable.rogers.com
Lines: 25
X-Authenticated-User: techsupp
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4351
Article PK: 8163


hbrofman wrote:
> since these are unsupported, does anyone know a way to
> implement LAST() or FIRST() via a stored procedures or
> function?

Please always post the version (and build number) of ASA are you using
(e.g. use the command "dbeng9 -v" for ASA 9.x).

First or last? I can guess at what they would do, but can you please
indicate the functionality you are after?

Have you looked at the FIRST clause for the SELECT statement that was
first introduced in ASA 7.0.0? Is this able to do what you are looking for?

BTW: the ASA newsgroup most likely appropriate for this type of question
is sybase.public.sqlanywhere.general

greg.fenton
--
Greg Fenton
Consultant, Solution Services, iAnywhere Solutions
--------
Visit the iAnywhere Solutions Developer Community
Whitepapers, TechDocs, Downloads
http://www.ianywhere.com/developer/


Breck Carter [TeamSybase] Posted on 2005-04-17 12:56:56.0Z
From: "Breck Carter [TeamSybase]" <NOSPAM__bcarter@risingroad.com>
Newsgroups: ianywhere.public.general
Subject: Re: implementing last() or first() aggregate functions
Organization: RisingRoad Professional Services
Reply-To: NOSPAM__bcarter@risingroad.com
Message-ID: <hil461dohji4dj9cis28472ntoia3142fe@4ax.com>
References: <4261e7e3.2493.1681692777@sybase.com>
X-Newsreader: Forte Agent 2.0/32.640
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 208.254.244.99
X-Original-NNTP-Posting-Host: 208.254.244.99
Date: 17 Apr 2005 05:56:56 -0700
X-Trace: forums-1-dub 1113742616 208.254.244.99 (17 Apr 2005 05:56:56 -0700)
X-Original-Trace: 17 Apr 2005 05:56:56 -0700, 208.254.244.99
Lines: 30
X-Authenticated-User: TeamSybase
Path: forums-1-dub!not-for-mail
Xref: forums-1-dub ianywhere.public.general:4352
Article PK: 8166

What do they do?

I looked in MSS, MySQL, DB2, Oracle, ASE and ANSI 99 with no luck.

They exist in something call "Manifold"
http://exchange.manifold.net/manifold/manuals/5_userman/mfd50Aggregate_Functions.htm

Are you talking about Access? It uses different keywords
http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/dnarsql7/html/access2sql.asp

In particular, FIRST() in Access SQL is shown as MIN() in MSS SQL, and
LAST() is shown as STDEV OR STDEVP.

ASA does have MIN, MAX, STDDEV, STDDEV_POP and STDDEV_SAMP.

Breck

On 16 Apr 2005 21:36:51 -0700, hbrofman wrote:

>since these are unsupported, does anyone know a way to
>implement LAST() or FIRST() via a stored procedures or
>function?

--
SQL Anywhere Studio 9 Developer's Guide
Buy the book: http://www.amazon.com/exec/obidos/ASIN/1556225067/risingroad-20
bcarter@risingroad.com
RisingRoad SQL Anywhere and MobiLink Professional Services
www.risingroad.com