Skip to content

Instantly share code, notes, and snippets.

View phụ-lục-1D-1E.sql
-- Cập nhật cột SomayHVN_mapping ở bảng registration
update top (100) registration_2018 set SomayHVN_mapping = 'JF86E0036270'
update top (100) registration_2019 set SomayHVN_mapping = 'JF86E0036270'
-- Tạo bảng trung gian
create table report_1de (
DEALER_CODE varchar(50),
deliver_tinh varchar(50),
Arrival_month int,
View phụ-lục-1A-1B-1C.sql
-- Tạo bảng
CREATE TABLE [dbo].[deliver_2018](
[DELIVERY_NO] [varchar](50) NULL,
[DEALER_CODE] [int] NULL,
[MODEL_CODE] [varchar](50) NULL,
[TYPE_CODE] [varchar](50) NULL,
[COLOR_CODE] [varchar](50) NULL,
[F_HEADER] [varchar](50) NULL,
[F_NO] [int] NULL,
[E_HEADER] [varchar](50) NULL,
@handuy
handuy / import.sql
Created Apr 1, 2020
Import CSV to SQL Server
View import.sql
USE corona;
GO
BULK INSERT covid FROM '/COVID-19-geographic-disbtribution-worldwide (1).csv'
WITH (
FIRSTROW = 2,
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
);
GO
View sub.vtt
WEBVTT
1
00:00:00.000 --> 00:00:02.325
[MUSIC PLAYING]
2
00:00:05.427 --> 00:00:06.260
KAYCE BASQUES: Hola!
@handuy
handuy / 3.sql
Last active Sep 16, 2018
Cú pháp chạy: psql -U postgres -f [tên_file]. Chạy file 3.sql ở citus_woker_1, 3_test.sql ở citus_master
View 3.sql
DROP TABLE IF EXISTS series;
CREATE TABLE series (id int, description text);
SELECT create_reference_table('series');
@handuy
handuy / 5.sql
Created Sep 16, 2018
Cú pháp chạy: psql -U postgres -f [tên_file]. Chạy ở citus_master
View 5.sql
DROP TABLE IF EXISTS users CASCADE;
DROP TABLE IF EXISTS posts CASCADE;
DROP SCHEMA IF EXISTS course CASCADE;
CREATE TABLE users (id int PRIMARY KEY, name text, age int);
CREATE TABLE posts (id int PRIMARY KEY, title text, author_id int REFERENCES users(id));
@handuy
handuy / 4.sql
Created Sep 16, 2018
Cú pháp chạy: psql -U postgres -f 4.sql. Chạy ở citus_master
View 4.sql
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS posts;
DROP SCHEMA IF EXISTS course CASCADE;
CREATE TABLE users (id int PRIMARY KEY, name text, age int);
CREATE TABLE posts (id int PRIMARY KEY, title text, author_id int REFERENCES users(id));
@handuy
handuy / 2.sql
Last active Sep 16, 2018
Cú pháp chạy: psql -U postgres -f [tên_file]. Chạy file 2.sql ở citus_master, 2_test.sql ở citus_worker_1
View 2.sql
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS posts;
DROP SCHEMA IF EXISTS course CASCADE;
CREATE SCHEMA course;
CREATE TABLE users (id int, name text, age int);
@handuy
handuy / 1.sql
Last active Sep 16, 2018
Cú pháp: psql -U postgres -f [tên_file]. Chạy file 1.sql ở citus_master, 1_test.sql ở citus_worker_1
View 1.sql
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS posts;
CREATE TABLE users (id int, name text, age int);
CREATE TABLE posts (id int, title text);
SELECT create_reference_table('users');
@handuy
handuy / vietnamese_convert.sql
Created Jul 10, 2018
Convert Vietnamese character
View vietnamese_convert.sql
á a
à a
ã a
ạ a
ả a
A a
Á a
À a
à a
Ạ a
You can’t perform that action at this time.