0
이름, 나이, 주소가 3 개인 컬럼이 있습니다.
이름과 나이를 주소를 나타내는 복합 키로 사용하고 싶습니다.MySQL : 복합 키 참조
select * from usertable where (name,age)=('somename',someage);
하지만 난 같은 것을 할 싶습니다 :
Create table usertable (
name varchar(100) not null,
age int not null,
address varchar(100) not null,
constraint addresskey PRIMARY KEY(name,age)
);
이 작동 내가이 작업을 수행 할 때
select * from usertable where addresskey=('somename',someage);
나는 오류가 발생합니다.
사망 한 경우이 계획은 정상적으로 작동합니다. – Strawberry
@Strawberry, 단순한 예입니다. – stumped
원하는 것을 할 수 없습니다. 열의 이름을 명시 적으로 지정해야합니다. –