Skip to content

Instantly share code, notes, and snippets.

@garymanley
Created December 28, 2017 08:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save garymanley/a71274d5dad0768892a3f39e758c3f46 to your computer and use it in GitHub Desktop.
Save garymanley/a71274d5dad0768892a3f39e758c3f46 to your computer and use it in GitHub Desktop.
SQLSelectExample
USE [RUNNING]
GO
/****** Object: View [dbo].[v_history] Script Date: 28/12/2017 08:52:17 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER view [dbo].[v_history] as
select year(track_time) [Run_Year],
month(track_time) run_month ,
day(track_time) run_day ,
g.[file_name],
g.track_name,
g.track_time,
g.track_length,
g.track_duration,
g.track_max_speed,
round(track_duration/60,0) len_min,
case when [file_name] like '%Run%'
then 'Run'
when [file_name] like '%Walk%'
then 'Walk'
when [file_name] like '%Ride%'
then 'Bike'
end as exercise_type,
[user]
from GPX_HISTORY g
Where 1 = 1
GO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment