How to get info from two tables and combine them?
I have no clue on how to get info from two tables and merge them.
1) I have a table with a list of names and city address:
CREATE TABLE `Names` (
`Name` char(50) DEFAULT NULL,
`City` char(20) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
2) I have a table with names and qualifications:
CREATE TABLE `Qual` (
`name` char(50) DEFAULT NULL,
`qualification` char(5) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
A person can have multiple qualifications, so the table looks like:
Joe Smith A
Susan Green C
Joe Smith B
Frank Brown C
Frank Brown B
I would like to make a query or create a new table that looks like:
Name City QualificationA QualificationB QualificationC
Joe Smith New York Yes Yes No
Susan Green Miami No No Yes
Frank Brown Los Angeles No Yes Yes
No comments:
Post a Comment