[Mysql] 데이터 join, sum 예제
-korean 테이블 -history 테이블2 [1번] 방정환님의 데이터를 name, id, tel1, email, price의 총합계, service 출력 단, 이름, 아이디,전화번호1,이메일, 총구매가격, 통신사 로 출력 select korean.name as 이름, history.id as 아이디, korean.tel1 as 전화번호1, korean.email as 이메일,sum(history.goodsprice) as 총합계,korean.service as 통신사 from korean left join history on korean.id=history.id where korean.name='방정환'; select korean.name as 이름, history.id as 아이디, korean.t..
2022. 7. 7.
[Mysql] 테이블 생성하기 / select count(*)
table 생성 mysql> create table event( -> e_no int(8)not null auto_increment, -> e_id char(200)not null, -> e_pw varchar(250)not null, -> e_hp char(11)not null, -> e_mail char(100) null, -> e_vip char(10) null, -> e_sw enum('window','office','xbox')not null default 'window', -> e_date timestamp not null default current_timestamp, -> e_del datetime null default '0001-01-01 01:00:00', -> primary key(..
2022. 7. 4.