Joachim Breuer wrote:
Hello,
this SQL statement is from an Advantage Database Server. IBConsole with Interbase 2017 give me this error.
Which columns do i have to specify?
Error at line 1
Dynamic SQL Error
SQL error code = -607
Invalid command
must specify column name for view select expression
SQL - select KADS1.* from ADS as KADS1
inner join (select kdKundenNr, max(kdBestelldatum) as dBestelldatum from ADS group by kdKundenNr) as KADS2
on KADS1.kdKundenNr = KADS2.kdKundenNr and KADS1.kdBestelldatum = KADS2.dBestelldatum
You might want to ask this in the IB group as this will be 100% a server issue.
One thing you can try though is alias inside the derived table and qualify those
columns. Like
(select kad.kdKundenNr, max(kad.kdBestelldatum) as dBestelldatum from ADS kad
group by kad.kdKundenNr) as KADS2
Derived tables are new in 2017 so there are bound to be some issues in them.
You can also try the with version of it
WITH KADS2 as (select kdKundenNr, max(kdBestelldatum) as dBestelldatum from ADS
group by kdKundenNr)
select KADS1.*
from ADS as KADS1 join KADS2 on
KADS1.kdKundenNr = KADS2.kdKundenNr and
KADS1.kdBestelldatum = KADS2.dBestelldatum
--
Jeff Overcash (TeamB)
(Please do not email me directly unless asked. Thank You)
Learning is finding out what you already know. Doing is demonstrating that you
know it. Teaching is reminding others that they know it as well as you. We are
all leaners, doers, teachers. (R Bach)
Connect with Us