Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 04-08-2005, 10:49 AM   #1 (permalink)
gwarzocha
Registered User
 
Join Date: Apr 2005
Posts: 1
gwarzocha is on a distinguished road
Group By In Db2

I have the sql statement:

SELECT MONTH(DATA_PAGAMENTO) AS MONTH, YEAR(DATA_PAGAMENTO) AS YEAR, ANO_JUROS, SUM(VALOR_JUROS)
FROM GCON.JUROS_ELETROBRAS
WHERE ANO_JUROS = 2004
GROUP BY MONTH(DATA_PAGAMENTO), YEAR(DATA_PAGAMENTO), ANO_JUROS
ORDER BY MONTH, YEAR, ANO_JUROS

I want to use this statement with DB2 database. When i execute the statement i receive the message:

SQL0104N An unexpected token "(" was found following "". Expected tokens may
include: "FOR WITH FETCH ORDER UNION EXCEPT QUERYNO OPTIMIZE ".
SQLSTATE=42601

Someone has any suggestion?? I need group by the rows by month and year of a date value.

thanks!!
gwarzocha is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Database layout - opinions? Rafkin Everything SQL ( MySQL, MSSQL, DB2, Postgre, Oracle, etc...) 4 12-29-2004 07:36 AM
Group seeks to overturn 10 patents redhead Code Newbie News 0 07-06-2004 06:46 AM
Group posts code to exploit Windows flaw, attack computers redhead Code Newbie News 3 07-28-2003 07:41 AM


All times are GMT -8. The time now is 01:55 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting