Advertisement
thesuhu

MySQL Query

Apr 18th, 2022 (edited)
1,097
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 0.32 KB | None | 0 0
  1. # cari data yg kolom mengandung huruf
  2. SELECT * FROM <nama tabel> WHERE <nama kolom> REGEXP '[[:alpha:]]+';
  3.  
  4. # mendapatkan tanggal 1 bulan yang lalu
  5. SELECT DATE_SUB(NOW(), INTERVAL 1 MONTH);
  6.  
  7. # ubah collation dari field
  8. ALTER TABLE <nama tabel> MODIFY <nama kolom> CHAR(6) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement