2
Bitte könnten Sie mir helfen. Ich mache etwas falsch.Joining in Unterabfragen - STUFF
SELECT
EventSpotsJoin.Event, Links.LongLat
FROM
EventSpotsJoin
INNER JOIN
Links ON EventSpotsJoin.Spot = Links.IdLinks
ORDER BY
EventSpotsJoin.Event
Ergebnis ist
2054 39.0440182, -74.7659984
2054 28.29555, -80.60898333333333
2068 39.0440182, -74.7659984
2068 28.29555, -80.60898333333333
Und ich möchte lat lang in einer Reihe verbinden. Ich benutze diesen Code.
SELECT
[EventSpotsJoin].[Event],
STUFF((SELECT '|' + CAST(Links.LongLat AS nvarchar)
FROM [dbo].[EventSpotsJoin]
WHERE EventSpotsJoin.Spot = Links.IdLinks
FOR XML PATH ('')), 1, 1, '')
FROM
EventSpotsJoin
INNER JOIN
Links ON EventSpotsJoin.Spot = Links.IdLinks
ORDER BY
EventSpotsJoin.Event
und das Ergebnis ist falsch:
2054 39.0440182, -74.7659984|39.0440182, -74.7659984
2054 28.29555, -80.60898333333333|28.29555, -80.60898333333333
2068 39.0440182, -74.7659984|39.0440182, -74.7659984
2068 28.29555, -80.60898333333333|28.29555, -80.60898333333333
Ich brauche es von Event-Gruppe und kommen Sie nicht die gleiche lat lange Folge.
ist Ja, ich erwarte genau das, was Sie gesagt haben. Aber Ergebnis ist immer noch falsch :(Jeder lat lange in separater Zeile. 39,0440182, -74,7659984 28,29555, -80,60898333333333 39,0440182, -74,7659984 28,29555, -80,60898333333333 –
Yes I Ich habe dieses Skript einfach kopiert ... –
Ich bin zweifelhaft in dieser 'EventSpotsJoin.Spot = Links.IdLinks' Bedingung, da für das Ereignis 2054 in der Tabelle –