บทความ

กำลังแสดงโพสต์จาก กันยายน, 2015

คำสั่งเบื้องต้นสำหรับการใช้งานดาต้าเบส ในโปรแกรม Postgres

คำสั่งเบื้องต้นสำหรับการใช้งานดาต้าเบส ในโปรแกรม Postgres ----CREATE DATABASE ------- CREATE DATABASE "Bannk" WITH ENCODING='UTF8' CONNECTION LIMIT=-1;   ----select DATA------ select*from TestTable select*from TestTable where title like 'sattawat' select*from TestTable where title like 'sattawat' OR title like 'Arab' ------CREATE TABLE array---- CREATE TABLE array_int ( vector int[][] ); ------ALTER TABLE array---- ALTER TABLE array_int ADD COLUMN id inet NOT NULL; ------CREATE TABLE--------- CREATE TABLE TestTable ( code char(5), title varchar(40), CONSTRAINT code PRIMARY KEY(code) ); ---------ALTER TABLE--------- ALTER TABLE public.TestTable ADD COLUMN "Name" varchar(100); -------INSERT INTO------ INSERT INTO TestTable (code, title) VALUES (1, 'sattawat'), (2, 'Arab'); ----------- UPDATE--------- UPDATE TestTable SET code = '11' WHERE code = '1';