Sorry I forgot to mention that there are multiple records with silar data I want the unique data(With Latest LocalDataTime) for each site -
I just executed the following query - SELECT TOP(61) S.DataValue AS 'Wind_speed',
D.DataValue AS 'Wind_direction ',
Sites.SiteCode,
Sites.Longitude ,
Sites.Latitude
FROM DataValues S JOIN DataValues D...
User Profile
Collapse
-
It's not an aggregate query... I was just trying random stuff...
my two queries are
SELECT TOP(61) DataValue as 'Wind_speed', Sites.SiteCode, Sites.Longitude , Sites.Latitude, DataValues.Vari ableID, DataValues.Site ID
FROM DataValues INNER JOIN Sites ON DataValues.Site ID = Sites.SiteID
WHERE DataValues.Vari ableID = 3
SELECT TOP(61) DataValue as 'Wind_direction ', Sites.SiteCode, Sites.Longitude , Sites.Latitude,...Leave a comment:
-
Sorry, didn't get you, I don't know how to use pivot but tried to join two qierues but it didn't work,
Here's my failed query-
Select speed.DataValue AS 'Wind_speed', direction.DataV alue AS 'Wind_direction ', Sites.Latitude, Sites.Longitude , Sites.SiteCode
FROM DataValues AS speed
INNER JOIN DataValues AS direction ON speed.SiteID = direction.SiteI D
INNER JOIN Sites ON speed.SiteID = Sites.SiteID
...Leave a comment:
-
Problem with a complex SQL Query for SQL Server
Hi,
I want to do something like this -
Get Wind_direction, Wind_speed, SiteCode, Latitude, Longitude side by side-
The problem is that (DataValue as wind_direction) Wind_direction and (DataValue as)wind_speed are under the same column DataValue and for Wind_direction variableID is 4 and for Wind_speed is 3
the schema can be found here (Fixed to show instead - NeoPa)
And here's the query...Last edited by Niheel; Nov 18 '11, 01:14 AM. Reason: Added mandatory [CODE] tags for you and showed pic in post -
Accessing comma separated data from an javascript array object
I have a global array to which I provide data from one function and want to use that data into another function.
i.e. i get the values of sitecode, x and y from function A
siteCode = x = y =
windQueryDataAr ray = [[siteCode, x, y]];
I want to use this array in function B from which I want to compare value of siteCode with site code value I am getting from another...
No activity results to display
Show More
Leave a comment: