Show rows results on same row when Group BY fields
Show rows results on same row when Group BY fields
(OP)
I am collecting soil temperatures at different depths. Different crops have different temperature depths.
My data structure looks like this for each record for each location and depth. The data is the same for each day for this example.
ObsDate:
Location: (field location)
Depth: (for this crop I am measuring at 4", 12" 24" 36")
Temperature:
table picture showing only 1 location
What I am trying to do is have one row of data for each date and location with a column for each depth. When I added the GROUP BY line I only get Temp4 column and not the others.
Thank you for any help.
My data structure looks like this for each record for each location and depth. The data is the same for each day for this example.
ObsDate:
Location: (field location)
Depth: (for this crop I am measuring at 4", 12" 24" 36")
Temperature:
CODE --> MySQL
SELECT ObsDate, Location, CASE WHEN Depth = 4 THEN Temperature END Temp4, CASE WHEN Depth = 12 THEN Temperature END Temp12, CASE WHEN Depth = 24 THEN Temperature END Temp24, CASE WHEN Depth = 36 THEN Temperature END Temp36 FROM `temperature` GROUP BY ObsDate, Location
table picture showing only 1 location

What I am trying to do is have one row of data for each date and location with a column for each depth. When I added the GROUP BY line I only get Temp4 column and not the others.
Thank you for any help.
RE: Show rows results on same row when Group BY fields
CODE
Skip,
Just traded in my OLD subtlety...
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
You Matter...
unless you multiply yourself by the speed of light squared, then...
You Energy!
RE: Show rows results on same row when Group BY fields
CODE
Skip,
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
You Matter...
unless you multiply yourself by the speed of light squared, then...
You Energy!
RE: Show rows results on same row when Group BY fields
Here is the MySQL I am using to test and the resulting table
CODE --> MySQL
RE: Show rows results on same row when Group BY fields
CODE
My results
Skip,
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
You Matter...
unless you multiply yourself by the speed of light squared, then...
You Energy!
RE: Show rows results on same row when Group BY fields
RE: Show rows results on same row when Group BY fields
Skip,
Just traded in my OLD subtlety...
for a NUance!
"The most incomprehensible thing about the universe is that it is comprehensible" A. Einstein
You Matter...
unless you multiply yourself by the speed of light squared, then...
You Energy!