AW: AW: [firebird-support] CTE difficult question

2019-11-13 Thread 'Check_Mail' check_m...@satron.de [firebird-support]
-support] CTE difficult question Hi, from your description i really do not know what is working for you and what is not working. And your expectation. but to understand recursive CTE look at simple sample. Recursive CTE work throught tree. ### metadata

Re: AW: [firebird-support] CTE difficult question

2019-11-13 Thread liviuslivius liviusliv...@poczta.onet.pl [firebird-support]
Hi,   from your description i really do not know what is working for you and what is not working. And your expectation.   but to understand recursive CTE look at simple sample. Recursive CTE work throught tree.   ### metadata ### CREATE TABLE TEST_T

AW: [firebird-support] CTE difficult question

2019-11-13 Thread 'Check_Mail' check_m...@satron.de [firebird-support]
A - D - Y, material: Y Later I can build a sum from all materials, for example Z Thank you. Von: firebird-support@yahoogroups.com Gesendet: Dienstag, 12. November 2019 14:23 An: firebird-support@yahoogroups.com Betreff: AW: [firebird-support] CTE difficult question Ist it pos

AW: [firebird-support] CTE difficult question

2019-11-12 Thread 'Check_Mail' check_m...@satron.de [firebird-support]
Ist it possible somehow? I would get each Part and the complete Path for it. If the Part is a material, I would get it and the complete list with all parts from the first til the material itself. Thanks. Hello, I have the following situation: There are some parts wit

[firebird-support] CTE difficult question

2019-11-11 Thread 'Check_Mail' check_m...@satron.de [firebird-support]
Hello, I have the following situation: There are some parts with parts inside Part A has Part B inside Part A has Part C inside Part B has BA inside Part B has BB inside Part BA has BAA inside Part BA has also BAB inside Part BB has BBA inside Part C has CA inside A

Re: [firebird-support] CTE Spaces between every day

2019-08-12 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2019-08-12 11:53, 'Check_Mail' check_m...@satron.de [firebird-support] wrote: > Hello, > > I have created a CTE in a stored prodedure which gives me all terms of > the next days, for example: > > 01.10.2019 Meeting with.. > > 01.10.2019 Exkursion > > 02.10.2019 Termin > > 04.10.2019

AW: [firebird-support] CTE Spaces between every day

2019-08-12 Thread 'Check_Mail' check_m...@satron.de [firebird-support]
ve the actually date Thanks, it should work and it is okay. Best regards Olaf Von: firebird-support@yahoogroups.com Gesendet: Montag, 12. August 2019 15:04 An: firebird-support@yahoogroups.com Betreff: Re: [firebird-support] CTE Spaces between every day Maybe you cou

Re: [firebird-support] CTE Spaces between every day

2019-08-12 Thread Svein Erling Tysvær setys...@gmail.com [firebird-support]
port@yahoogroups.com > > *Gesendet:* Montag, 12. August 2019 12:17 > *An:* firebird-support@yahoogroups.com; 'Check_Mail' check_m...@satron.de > [firebird-support] > *Betreff:* Re: [firebird-support] CTE Spaces between every day > > > > > > Hi, >

AW: [firebird-support] CTE Spaces between every day

2019-08-12 Thread 'Check_Mail' check_m...@satron.de [firebird-support]
record and the new one. I thought, there is a simplier way. Thank you. Von: firebird-support@yahoogroups.com Gesendet: Montag, 12. August 2019 12:17 An: firebird-support@yahoogroups.com; 'Check_Mail' check_m...@satron.de [firebird-support] Betreff: Re: [firebird-support] CTE Spac

Re: [firebird-support] CTE Spaces between every day

2019-08-12 Thread liviuslivius liviusliv...@poczta.onet.pl [firebird-support]
Hi,   simply add loop inside do   begin      suspend;     --put here some loop     while something do       begin           --modify output variables here           suspend;       end   end;   regards, Karol Bieniaszewski

[firebird-support] CTE Spaces between every day

2019-08-12 Thread 'Check_Mail' check_m...@satron.de [firebird-support]
Hello, I have created a CTE in a stored prodedure which gives me all terms of the next days, for example: 01.10.2019 Meeting with.. 01.10.2019 Exkursion 02.10.2019 Termin 04.10.2019 Termin XX Now I would set between every day a blank record, a kind of space. 01.10.2019 Me

AW: [firebird-support] CTE, tricky request

2019-06-13 Thread 'Check_Mail' check_m...@satron.de [firebird-support]
ear from temp_date); suspend; temp_date = temp_date + 30; end end it works.. Von: firebird-support@yahoogroups.com Gesendet: Donnerstag, 13. Juni 2019 16:36 An: firebird-support@yahoogroups.com Betreff: [firebird-support] CTE, tricky request Hello, I would like to generate

[firebird-support] CTE, tricky request

2019-06-13 Thread 'Check_Mail' check_m...@satron.de [firebird-support]
Hello, I would like to generate a list with appointments. In a table tkal_main I set the day (field "t") of the meeting, every month I would like to get an entry. The description of the appointment is "bez". I helps me with a separate table (tmonate, id 1 = January and so on). Wit

RE: [firebird-support] CTE query works on fb 2.5 but not on fb 3.0

2018-02-01 Thread Rudi Feijó rudi.fe...@multidadosti.com.br [firebird-support]
Thanks a lot Mark ! >Your problem has nothing to do with CTEs, you are combining implicit > (SQL-89) joins and explicit (SQL-92) joins, and referencing the >implicitly joined table from the explicitly joined tables. The rules for >these have changed in Firebird 3 to be compliant with the SQL >

Re: [firebird-support] CTE query works on fb 2.5 but not on fb 3.0

2018-02-01 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
Your problem has nothing to do with CTEs, you are combining implicit (SQL-89) joins and explicit (SQL-92) joins, and referencing the implicitly joined table from the explicitly joined tables. The rules for these have changed in Firebird 3 to be compliant with the SQL specification and to avoid

[firebird-support] CTE query works on fb 2.5 but not on fb 3.0

2018-02-01 Thread Rudi Feijó rudi.fe...@multidadosti.com.br [firebird-support]
Good afternoon. I’ve been assigned to debug a query that was working on 2.5 but stopped workin on 3.0. As of now I have little information on the context of where this query is used, but I’m assuming it might be something simple. Apparently what’s causing the error is using this FROM sintax

Re: [firebird-support] CTE Recursive left join problem

2017-10-02 Thread 'livius' liviusliv...@poczta.onet.pl [firebird-support]
mytable.id and mytable.id +1 and mytable.id is not null ... regards, Karol Bieniaszewski From: Germán Balbi bal...@yahoo.com [firebird-support] Sent: Monday, October 2, 2017 7:37 PM To: Firebird-support Subject: [firebird-support] CTE Recursive left join problem Hello everyone I'm hav

[firebird-support] CTE Recursive left join problem

2017-10-02 Thread Germán Balbi bal...@yahoo.com [firebird-support]
Hello everyoneI'm having a problem, and I do not understand why.I have a structure similar to: with recursive  aux as (   select 0 as n     from rdb$database  union all  select aux.n + 1     from aux     where aux.n <= 20  )  select aux.n, mytable.id  from aux    LEFT JOIN mytable on aux.n between

AW: [firebird-support] CTE Question

2017-05-02 Thread 'Olaf Kluge' olaf.kl...@satron.de [firebird-support]
ups.com] Gesendet: Dienstag, 2. Mai 2017 08:36 An: firebird-support@yahoogroups.com <mailto:firebird-support@yahoogroups.com> Betreff: AW: [firebird-support] CTE Question Hi SET, I would like to specify this: Table A: CREATE TABLE T_L_PRKOM_GRP ( ID_GRP INTEGER NOT NULL, ID_KOM INTEG

AW: [firebird-support] CTE Question

2017-05-01 Thread 'Olaf Kluge' olaf.kl...@satron.de [firebird-support]
Sorry, 3 categories = 3 layer Von: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Gesendet: Dienstag, 2. Mai 2017 08:36 An: firebird-support@yahoogroups.com Betreff: AW: [firebird-support] CTE Question   Hi SET, I would like to specify this: Table A: CREATE

AW: [firebird-support] CTE Question

2017-05-01 Thread 'Olaf Kluge' olaf.kl...@satron.de [firebird-support]
- Von: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Gesendet: Freitag, 28. April 2017 22:17 An: firebird-support@yahoogroups.com Betreff: Re: [firebird-support] CTE Question Hi Olaf! First, SQL doesn't like unknown columns, you need to know at least the max

Re: [firebird-support] CTE Question

2017-04-28 Thread setysvar setys...@gmail.com [firebird-support]
Hi Olaf! First, SQL doesn't like unknown columns, you need to know at least the maximum possible number of properties to support. Having said that, you could try something like: select B1.Property, B2.Property, B3.Property, B4.Property from TableA A1 join TableB B1 on A1.ID = B1.ID_TableA left

[firebird-support] CTE Question

2017-04-28 Thread 'Olaf Kluge' olaf.kl...@satron.de [firebird-support]
Hello, in advance, many thanks! I would like to combine all properties like this: Property1 Property2 Property3 Property4.. IP54 Yellow With lamp 30W IP20 Blue Without lamp

[firebird-support] CTE

2016-10-12 Thread 'Check_Mail' check_m...@satron.de [firebird-support]
Hello everybody, actually I have a stored procedure where I get the needet material for each product, some of them I get many times. Now I would like to create A CTE and gets the amount of each material. In my case I call a stored procedure and those calls itself. Here the example:

Re: AW: [firebird-support] CTE

2014-02-26 Thread Tim Ward
I've just this minute come across this again, with INSERT this time rather than UPDATE. For my current problem the following code does not give an error: INSERT INTO ... WITH CTE_X AS ( ... ) SELECT ... FROM CTE_X WHERE ... -- Tim Ward

AW: [firebird-support] CTE

2014-02-26 Thread checkmail
Hello @ll, thanks a lot! So many solutions J Von: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Im Auftrag von Svein Erling Tysvær Gesendet: Mittwoch, 26. Februar 2014 13:00 An: firebird-support@yahoogroups.com Betreff: RE: [firebird-support] CTE >He

RE: [firebird-support] CTE

2014-02-26 Thread Svein Erling Tysvær
>Hello, > >I get an error message during executing the following statement: > >with mat as ( >select  a.teilenr, c.vkpreis, a.matteilenr, c.bezeichnung from tmaterial a >left join tteile c on a.teilenr = c.teilenr >where a.kundennr = 24823 ) >update tteile set tteile.minvk = mat.vkpreis * 0.90 whe

Re: [firebird-support] CTE

2014-02-26 Thread Mark Rotteveel
On Wed, 26 Feb 2014 11:43:24 +0100, "checkmail" wrote: > Hello, > > I get an error message during executing the following statement: > > with mat as ( > > select a.teilenr, c.vkpreis, a.matteilenr, c.bezeichnung from tmaterial a > left join tteile c on a.teilenr = c.teilenr > > where a.kunden

Re: [firebird-support] CTE

2014-02-26 Thread Tim Ward
Yeah, I wanted to do this the other day (but found a different way to structure the query so never got round to posting the question here). The Firebird book contains what I found to be incomplete and contradictory information on this point. On 26/02/2014 10:43, checkmail wrote: Hello, I g

[firebird-support] CTE

2014-02-26 Thread checkmail
Hello, I get an error message during executing the following statement: with mat as ( select a.teilenr, c.vkpreis, a.matteilenr, c.bezeichnung from tmaterial a left join tteile c on a.teilenr = c.teilenr where a.kundennr = 24823 ) update tteile set tteile.minvk = mat.vkpreis * 0.90 wher

[firebird-support] CTE Problem

2012-11-06 Thread Frank
Hi, I do not understand why set planonly; with recursive CTE_CNT1 as (select 0 as I from RDB$DATABASE union all select I + 1 from CTE_CNT1 where I < 9), CTE_CNT2 as (select I, 0 as J from CTE_CNT1 union all select J * 10 + c1.I, c2.J + 1 from CTE_CNT1 c1 join

RE: [firebird-support] CTE with unknown input parameter

2012-05-23 Thread Svein Erling Tysvær
>My real problem/question is that I don't know the value of :FromMainTable >until the main select attempts: > >LEFT JOIN MyCTE CTE ON MT.Afield = CTE.FromMainTable > >The simplest way to put my question would then be (though oversimplifying, >probably leading to answers that doesn't work in the r

RE: [firebird-support] CTE with unknown input parameter

2012-05-23 Thread Svein Erling Tysvær
>Hello Set, Hello Martijn! >> WITH MyCTE AS >> (SELECT CAST(:FromMainTable AS VarChar(5)) FromMainTable, Field1 > >Wouldn't this be the value of Field2 then? Sure, but that's not the problem (just a desparate workaround I attempted). >> UNION >> SELECT CAST(:FromMainTable AS VarChar(5)), Field1

Re: [firebird-support] CTE with unknown input parameter

2012-05-22 Thread Martijn Tonies
Hello Set, > Hi, I'm trying to use a CTE a bit differently from what I usually do, but > am failing. > > WITH MyCTE AS > (SELECT CAST(:FromMainTable AS VarChar(5)) FromMainTable, Field1 Wouldn't this be the value of Field2 then? > FROM MySmallLookupTable > WHERE Field2 = :FromMainTable > UNION

[firebird-support] CTE with unknown input parameter

2012-05-22 Thread Svein Erling Tysvær
Hi, I'm trying to use a CTE a bit differently from what I usually do, but am failing. WITH MyCTE AS (SELECT CAST(:FromMainTable AS VarChar(5)) FromMainTable, Field1 FROM MySmallLookupTable WHERE Field2 = :FromMainTable UNION SELECT CAST(:FromMainTable AS VarChar(5)), Field1 FROM MySmallLookupTabl