Subject index with lower case
Author Paul Mercea
Hi

I have FB 1.5.3 database with dialect 3.
I want to use some codification with lower and upper case for table naming.
So, I have created tables with lower case and with upper case, using
IBExpert.

Index definition for lower case:
ALTER TABLE "sys_company" ADD CONSTRAINT "pk_sys_company" PRIMARY KEY
("com_id");

Index definition for upper case
ALTER TABLE SYSCOM ADD CONSTRAINT PK_SYSCOM PRIMARY KEY (COMNUM);

I wonder why for lower case I have "" for names ?????

TIA
Paul

-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of radevojvodic
Sent: Tuesday, February 14, 2006 10:06 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] MAX and SUM in the same query

Hi All,

I have a table like this

ID, LEDGER_ID, PRICE, DEBIT, CREDIT, ITEM

I have to find Price where LEDGER_ID = MAX(LEDGER_ID) for each ITEM
and at the same time SUM(DEBIT), Sum(CREDIT) for that item. I have
tried to Join the table (lets name it journal) to itself and to use
having clause to get it to work. It does work but it's very slow. Is
there anyone that can help me to optimize the query.

Rade





++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Visit http://firebird.sourceforge.net and click the Resources item
on the main (top) menu. Try Knowledgebase and FAQ links !

Also search the knowledgebases at http://www.ibphoenix.com

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Yahoo! Groups Links