예약된 키워드이므로 테이블 이름 참조를 제공할 수 없습니다. 백틱을 사용하여 래핑합니다(예:'참조').
먼저 테이블을 생성하겠습니다 -
mysql> create table `references`(Subject text); Query OK, 0 rows affected (0.44 sec)
삽입 명령을 사용하여 테이블에 일부 레코드 삽입 -
mysql> insert into `references` values('Introduction To MySQL');
Query OK, 1 row affected (0.28 sec)
mysql> insert into `references` values('Introduction To MongoDB');
Query OK, 1 row affected (0.15 sec)
mysql> insert into `references` values('Introduction To Spring and Hibernate');
Query OK, 1 row affected (0.13 sec)
mysql> insert into `references` values('Introduction To Java');
Query OK, 1 row affected (0.18 sec) select 문을 사용하여 테이블의 모든 레코드 표시 -
mysql> select *from `references`;
그러면 다음과 같은 출력이 생성됩니다. -
+--------------------------------------+ | Subject | +--------------------------------------+ | Introduction To MySQL | | Introduction To MongoDB | | Introduction To Spring and Hibernate | | Introduction To Java | +--------------------------------------+ 4 rows in set (0.00 sec)