[MySQL] 시간을 처리하는 방법:curdate(), curtime(), now()
- 관련 튜토리얼: https://www.tutorialspoint.com/mysql/mysql-date-time-functions.htm\ create a table desc people2; insert into people2 (name,birthdate, birthtime, birthdt) values ('Padma','1988-11-11','10:07:35','1988-11-11 10:07:35'), ('Larry','1994-04-22','04:10:42','1994-04-22 04:10:42'); select * from people2; 시간을 처리하는 방법:curdate(), curtime(), now() -- date, time, datetime -- date: YYYY-MM-DD -- ti..
더보기
[MySQL] 중복없이 데이터 가져오기: distinct
use yh_db; select * from books; select * from yh_db.books; select * from 데이터베이스 이름.테이블 이름 -- 이때는 use 안써도 됨. .(점)의 뜻은 '~의'라는 뜻 insert into books (title, author_fname,author_lname,released_year,stock_quantity,pages) values ('10% Happier','Dan','Harris',2014, 29, 256), ('fake_book','Freida','Harris',2001,287,428), ('Lincon In The Bardo','George','Saunders', 2017, 111, 388); select * from books; 중복없..
더보기
[MySQL] concat, concat_ws, substring, substr, replace, reverse, char_length, upper, lower
하기 텍스트 입력(앞에 use yh_db 작성하고) INSERT INTO books (title, author_fname, author_lname, released_year, stock_quantity, pages) VALUES ('The Namesake', 'Jhumpa', 'Lahiri', 2003, 32, 291), ('Norse Mythology', 'Neil', 'Gaiman',2016, 43, 304), ('American Gods', 'Neil', 'Gaiman', 2001, 12, 465), ('Interpreter of Maladies', 'Jhumpa', 'Lahiri', 1996, 97, 198), ('A Hologram for the King: A Novel', 'Dave', 'Eg..
더보기