Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql lag

	 -- Employee --
------------------------
| 1 | Mae | 01.02.2018 |
| 2 | Jon | 15.04.2018 |
| 3 | Eve | 28.06.2018 |
------------------------

SELECT id, name, 
       Lag(DateColumn, 1) OVER(ORDER BY DateColumn ASC) AS EndDate
FROM @Employee;

-- Add new column and shift line + 1 of DateColumn
-------------------------------------
| 1 | Mae | 01.02.2018 | NULL		|
| 2 | Jon | 15.04.2018 | 01.02.2018 |
| 3 | Eve | 28.06.2018 | 15.04.2018 |
-------------------------------------

-- See the source for better explanation
Comment

sql latlng

For longitudes use: Decimal(9,6), and latitudes use: Decimal(8,6)
Comment

PREVIOUS NEXT
Code Example
Sql :: postgresql backup and restore globals and data 
Sql :: postgres extract date from timestamp 
Sql :: postgre query date 
Sql :: oracle error line 
Sql :: database get 10 user aleatory 
Sql :: sql alter column name sql server 
Sql :: from . import _mysql ImportError: libmariadb.so.3: cannot open shared object file: No such file or directory linux 
Sql :: how to duplicate mysql table 
Sql :: how to insert a uniqueidentifier in sql 
Sql :: client does not support authentication protocol requested by server sqlyog 
Sql :: generate sql from specific migration ef core 
Sql :: mysql remove database 
Sql :: bigquery current time 
Sql :: how to get the maximum length of a name in sql 
Sql :: copy column from one table to another without column duplicate postgres 
Sql :: run psql postgres docker 
Sql :: Add a new column into table 
Sql :: how to comment in sql 
Sql :: import database mysql command line 
Sql :: Drop check constraint in ms sql 
Sql :: declare date variable sql 
Sql :: list mysql tables and views 
Sql :: difference between in and between in sql 
Sql :: minus equivalent in my sql 
Sql :: SQL get max per id 
Sql :: oracle last connection 
Sql :: intersect sql 
Sql :: retrieve all data from a one row in mysql 
Sql :: sql contains vs like 
Sql :: mysql pass command from command line 
ADD CONTENT
Topic
Content
Source link
Name
5+9 =