Re: [firebird-support] info

2017-01-05 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
This "Problem" is listed in the tracker: http://tracker.firebirdsql.org/browse/CORE-1645 I don't understand who ever though of supporting case-behaviour, why the hell should i want a table named "ATable" and "atable" and both different tables. Anyway this is something what is inherited from the

Re: [firebird-support] Left join derived table

2016-09-28 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
Hi, > SELECT A.FIELD_1, A.FIELD_2, D.FIELD_D1, D.FIELD_D2 > FROM TABLE_A A > LEFT JOIN (SELECT FIRST 1 D.FIELD_D1, D.FIELD_D2, D.FIELD_3 FROM TABLE_D D > ORDER BY D.ID DESC) D ON D.FIELD_3 = A.FIELD_3 I assume this is not what he wants. The reason is the FIRST 1 in the derived table! The (D.FI

Re: [firebird-support] Optimizer request

2016-09-10 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
Which Firebird version are you using? Does this perform for you as expected: SELECT * FROM (SELECT partners.partid + 0 AS PartID FROM partners WHERE partners.country = 'Spain') dt JOIN orders ON (orders.partid = dt.partid) Kind Regards, Arno Brinkman From: mailto:firebird-support@y

Re: [firebird-support] Optimizer request

2016-09-09 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
Hi, As others already suggested i would also prefer EXISTS, but anyway there is missing an index on Country. The IN sub-select is not taking into cache and then used for the index on orders.partid. If you want that optimalisation then go for a derived table to join against. Kind Regards, Arno

Re: [firebird-support] SQL Error Code -104: What is wrong with this rather simply SQL?

2016-04-06 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
Hi, The message doesn’t tell you which expression is not contained in an aggregate function or GROUP BY clause, but is very clear that it is “P.PHONE_ID” Not sure what you trying to achieve, but your SQL is indeed invalid, because there can be multiple PHONE_ID’s per AREA_CODE, PHONE_NO Kind R

Re: AW: AW: AW: [firebird-support] coalesce bug in fb 3.0 rc2?

2016-03-10 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
Hi, Thank you for providing a script, this is much easier comparing. I can now reproduce the error you get. Please enter a ticket with this script into the tracker, so they can fix this issue. Enter these both queries, so they can quickly find the bug: The query with the wrong results: SELEC

Re: AW: AW: [firebird-support] coalesce bug in fb 3.0 rc2?

2016-03-09 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
Hello, > your are right. But in FB 3, it will be handled different. > I need the left join tlager_sum, because I’d like to have all records too > there no records in tlager_sum. > But in this case I get now in fb 3 the tteile.teilenr clean without the > amaount of tlager_sum (the a.minb is grea

Re: AW: [firebird-support] coalesce bug in fb 3.0 rc2?

2016-03-09 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
Hello, > sorry, outlook corrects me in German. At the moment, I have no sulution > for the problem. Anything ideas? Query: SELECT a.teilenr, a.bezeichnung, a.minb, coalesce(b.menge,0) as m, a.typ FROM tteile a left join tlager_sum b on (a.teilenr = b.teilenr) WHERE ((a.minb > coalesce(

Re: [firebird-support] Firebird 3.0 RC1 - SQL optimization help

2016-01-20 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
Hello, You have no indices defined at all. While i don’t understand your system i cannot really say what indices you should add, but these will at least help: CREATE ASC INDEX I_TERMINAL_SAYIM ON TERMINAL_SAYIM (BELGENO, ADRESKODU, ISLEMTURU, BARKOD, OLCUBIRIMI, TEKPARCA); Kind Regards, Arno

Re: [firebird-support] 'Invalid expression' error in GROUP BY when field based on a SQL statement is used in SELECT field list

2016-01-18 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
May be this is what you want: SELECT ReceiptID, (SELECT FIRST 1 S.Service FROM ReceiptLine RLF JOIN Service S ON (S.ServiceID = RLF.ServiceID) WHERE RLF.ReceiptLineID = MIN(RL.ReceiptLineID) ) AS Service, SUM(Qty*Cost) Price FROM ReceiptLine RL GROUP BY ReceiptID Regards,

Re: [firebird-support] FB 3.0

2015-11-10 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
Support for Users of Firebird ReleasesHi, Just quickly restored a FB2 DB in FB3 and connected with the Application (Build in Delphi 7 using IBX). I copied the fbclient.dll from the install directory into the application directory and renamed to gds32.dll No problems i ran into. Met vriendelijke

Re: [firebird-support] Conditional where statements

2015-11-05 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
My mail was not complete yet :-) Another solution could be building the query up with the conditions and use "EXECUTE STATEMENT " in the stored procedure But note that this has also drawbacks, the query need to be prepared every time the SP is called, but this could still win due the beter

Re: [firebird-support] Conditional where statements

2015-11-05 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
Hi, Another solution could be building the query up with the conditions and use "EXECUTE STATEMENT " in the stored procedure Kind Regards, Arno Brinkman ABVisie -Oorspronkelijk bericht- From: Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support] Sent: Thursday, Novembe

Re: [firebird-support] SQL Optimation best way

2015-11-04 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
Hi, You’re already have good suggestions, but mainly we’re missing input of what you exactly want and how the data is related. Here another SQL example which could bring you by a solution: SELECT SUM(a.Field3), dt.SumFieldC FROM TableA a LEFT JOIN (SELECT b.FieldA, b.FieldB, SUM(b.Field

Re: [firebird-support] Firebird Temporary Table

2015-10-30 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
Hello, > I am using firebird 2.5. > Need to use temporary table on my stored procedures. I am able to create > temporary table using create global temporary table command. > But when i select it, it returns 'unknown table' error. Did i do it wrong > ? > I would like to know how to use global te