Re: difficult select- question
Date: Tue, 17 Nov 2009 17:48:49 +0100
Maxim Demenko schrieb am 17.11.2009 in <4B024E96.2010503_at_gmail.com>:
> Andreas Mosmann wrote:
>> Andreas Mosmann schrieb am 02.11.2009 in
>>> Maxim Demenko schrieb am 27.10.2009 in <4AE6A3AF.4020506_at_gmail.com>:
>> Similar question, similar answer?
>> the situation before is
>> and the result should be
>> Is there a similar way to get this? Your way is very fast.
>> Many thanks in advance
>> Andreas Mosmann
> Could you explain a bit the logic behind your desired results? > In particular, it's unclear for me, based on what should the line No problem. We talk about streets, that are handled as a net of nodes and edges. The position of a point object is described as a combination of both nodes and the relative position to the first node. If I f.e. have an Edge AA->BB with the length 100 and there are Points by 10, 30 and 40 I at the end need something like that
N1|N2|POS AA|BB|10 AA|BB|30 AA|BB|40
N1|N2|FROM|TO AA|BB| 10 |30 AA|BB| 30 |40
I also have to add
AA|BB| 0 | 10
AA|BB| 40 |100
but I am afraid not understanding the answer if I you fill out these lines too.
In the table I of course have more than one pair of nodes. If I would do this by algorithm it would be easy. It is easy to find a query like
POS as FROM,
(SELECT MIN(POS) FROM STREETS I WHERE I.N1=O.N1 and I.N2=O.N2 and I.POS>O.POS) as TO
STREETS O (I should no use from as a column name, I know) But this query of course is very slow.
Is there a place I can read about handling the type of query you used?
> be generated
> Best regards
Many thanks again,
I am really excited
-- wenn email, dann AndreasMosmann <bei> web <punkt> deReceived on Tue Nov 17 2009 - 10:48:49 CST