coding with cong

  • 홈
  • 방명록
  • 태그
  • 카테고리

DISTINCT 2

[MySQL] 뷰 view 생성 예제

1학기 수업을 듣는 학생들을 검색 출력: 학번, 이름 조건: 1학기 / 중복제거 추가 출력: 과목이름 중복제거를 하지 않는 경우 ! 조건에 맞는 학생이름 전체 출력, 조건에 맞는 번호 전체 출력 = 2번출력 -- 학번, 이름, 중복제거 mysql> create or replace view 1term_view as -> select distinct s.st_name, s.st_num -> from student as s, course as c -> where c.co_term = 1; Query OK, 0 rows affected (0.00 sec) mysql> select * from 1term_view; +---------+------------+ | st_name | st_num | +--------..

DB/명령프롬프트 - mysql 2023.03.30

[MySQL] 테이블 데이터 변경, 삭제, 중복제거 Update, delete, distinct

테이블 튜플(안의 데이터) 변경 : Update -- 데이터 변경 Update 테이블명 set 바꿀칼럼 = '값' where 조건 ; -- 타 테이블에서 값을 가져와 데이터 변경 update 테이블명 set 칼럼명 = (select 타테이블칼럼명 from 타테이블명 where 조건 ) ; /* 강감찬의 major1을 'computer'로 변경 */ mysql> update student set major1='computer' where num=4444; mysql> select * from student; +------+--------+------+---------+----------+-------+ | num | name | age | address | major1 | score | +------+--..

DB/명령프롬프트 - mysql 2023.03.27
이전
1
다음
더보기
프로필사진

coding with cong

콩의 작은 개발 블로그

  • 분류 전체보기 (441)
    • JAVA (70)
      • java (41)
      • java 코드 (29)
    • DB (63)
      • MySQL Workbench (12)
      • 명령프롬프트 - mysql (51)
    • HTML.CSS.JS (169)
      • html (24)
      • css (18)
      • JS (127)
    • JSP (52)
      • JSP (52)
    • Spring (40)
      • Spring-eclipse (20)
      • Spring (2)
      • Springboot-Intellij (18)
    • GIT (6)
      • GIT (4)
      • GIT ERROR (2)
    • Node.js (3)
    • 코딩테스트 (32)
    • 컴활 1급 실기 (3)

Tag

if, erd, Integer.parseInt, is not null, random, Update, Table, while, select, mysql, intstream, indexOf, Trigger, concat, for, modify, substring, create, join, Class,

최근글과 인기글

  • 최근글
  • 인기글

최근댓글

공지사항

페이스북 트위터 플러그인

  • Facebook
  • Twitter

Archives

Calendar

«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

방문자수Total

  • Today :
  • Yesterday :
콩의 깃허브!

꾸준한 개발자가 되고 싶은 콩의 블로그입니다.

공재불사! 열심히 노력해봐요!

티스토리툴바