-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path4.sql
More file actions
21 lines (17 loc) · 798 Bytes
/
Copy path4.sql
File metadata and controls
21 lines (17 loc) · 798 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
CREATE TABLE Emp_Details (
EMPID int,
Gender varchar(5),
EmailID varchar(30),
DeptID int);
INSERT INTO Emp_Details VALUES (1001,'M','YYYYY@gmaix.com',104);
INSERT INTO Emp_Details VALUES (1002,'M','ZZZ@gmaix.com',103);
INSERT INTO Emp_Details VALUES (1003,'F','AAAAA@gmaix.com',102);
INSERT INTO Emp_Details VALUES (1004,'F','PP@gmaix.com',104);
INSERT INTO Emp_Details VALUES (1005,'M','CCCC@yahu.com',101);
INSERT INTO Emp_Details VALUES (1006,'M','DDDDD@yahu.com',100);
INSERT INTO Emp_Details VALUES (1007,'F','E@yahu.com',102);
INSERT INTO Emp_Details VALUES (1008,'M','M@yahu.com',102);
INSERT INTO Emp_Details VALUES (1009,'F','SS@yahu.com',100);
select * from Emp_Details;
select DeptID,group_concat(EmailID order by EmailID asc SEPARATOR ";")
as cat from Emp_Details group by DeptID;