Tips Cara Menciptakan Sequence Di Mysql

Pada tutorial MySQL kali ini, kita akan berguru wacana Cara Membuat Sequence. Sequence yaitu data yang berurutan misalkan 1, 2, 3, dan seter...

A+ A-

INSERT INTO product(product_name) VALUES ('Indomie'); INSERT INTO product(product_name) VALUES ('Sabun Mandi'); INSERT INTO product(product_name) VALUES ('Susu'); INSERT INTO product(product_name) VALUES ('Teh'); INSERT INTO product(product_name) VALUES ('Kopi'); 
Untuk mengambarkan apakah kolom product_id datanya berurutan dari 1, 2, 3, dan seterusnya, Anda sanggup menjalankan select statement berikut ini:

mysql> select * from product; +------------+--------------+ | product_id | product_name | +------------+--------------+ |          1 | Indomie      | |          2 | Sabun Mandi  | |          3 | Susu         | |          4 | Teh          | |          5 | Kopi         | +------------+--------------+ 5 rows in set (0.00 sec) 

Related

MySQL 3552633604634991684

Technology

Hot in weekRecentComments

Hot in week

Recent

Comments

item