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 :: sql email Regex 
Sql :: how to know the character set of an oracle databes 
Sql :: download sql server 2016 
Sql :: sql update insert and delete 
Sql :: create database in mysql 
Sql :: stored procedure to delete data from table in mysql 
Sql :: postgresql not case sensitive where in 
Sql :: import sql dump into postgresql database 
Sql :: MySQL INSERT IGNORE Statement 
Sql :: psql load dump 
Sql :: oracle partition table row count 
Sql :: oracle shrink table 
Sql :: sql constraint check value in list 
Sql :: sql server to uppercase 
Sql :: Converting mysql tables to charset utf8mb4 
Sql :: grant all privileges microsoft sql 
Sql :: execute sp in sql server 
Sql :: power bi dax is in the last 3 months 
Sql :: setval max id postgresql sequence 
Sql :: mysql: command not found 
Sql :: sql download for windows 10 
Sql :: drop function in sql 
Sql :: invalid column name sql 
Sql :: using minus query in SQL 
Sql :: move table to a different schema 
Sql :: insert array into mysql column 
Sql :: sql column name 
Sql :: sql select inside select 
Sql :: ms sql server port 
Sql :: get locked tables sql server 
ADD CONTENT
Topic
Content
Source link
Name
5+1 =