Manipulating duplicates by merging similar (Is it possiple) I have row 1 and 2 which they are similar in records except status column.

   +-----+------+-------+-----------+----------+---------+
| #id | NAME | STATUS|   c_lan   | Java_lan | Dot_lan |
+-----+------+-------+-----------+----------+---------+
|   1 |  A   |   111 |      yes  |    Q     | W       |
|   1 |  A   |   222 |      yes  |    Q     | W       |
+-----+------+-------+-----------+----------+---------+


Now is it possible to have these tow rows (1,2) become as one row as like  below (need to merge status values in to one cell)?

+-----+------+-----------+-----------+----------+---------+
| #id | NAME | STATUS    |   c_lan   | Java_lan | Dot_lan |
+-----+------+-----------+-----------+----------+---------+
|   1 | A    |   111,222 |      yes  |    Q     | W       |
+-----+------+-----------+-----------+----------+---------+


noting that i am considering this to be done on mysql view
Use GROUP_CONCAT() for this.

Your table:

create table foo
(
id int,
name varchar(10),
status int,
c_lan varchar(10),
Java_lan varchar(10),
Dot_lan varchar(10)
);

insert into foo values (  1,'A',111,'yes','Q','W'   );

insert into foo values (  1,'A',222,'yes','Q','W'   );


Testcase:

mysql&gt; select id, GROUP_CONCAT(status separator ',') as status, c_lan, Java_lan, Dot_lan from foo group by id;
+------+---------+-------+----------+---------+
| id   | status  | c_lan | Java_lan | Dot_lan |
+------+---------+-------+----------+---------+
|    1 | 111,222 | yes   | Q        | W       |
+------+---------+-------+----------+---------+
1 row in set (0.00 sec)

mysql&gt;


View:

create view concatview as (
select id, GROUP_CONCAT(status separator ',') as status, c_lan, Java_lan, Dot_lan
from foo
group by id
);


Test:

mysql&gt; select * from concatview;
+------+---------+-------+----------+---------+
| id   | status  | c_lan | Java_lan | Dot_lan |
+------+---------+-------+----------+---------+
|    1 | 111,222 | yes   | Q        | W       |
+------+---------+-------+----------+---------+
1 row in set (0.00 sec)

mysql&gt;


Obviously you may want to GROUP on more than just id (depending on what you consider a "duplicate", and may want to order the GROUP_CONCAT() in some way, but this points you in the right direction.

Edit to address your comment:

mysql&gt; insert into foo values ( 2,'b',555,'yes','Q','W' );
Query OK, 1 row affected (0.00 sec)

mysql&gt;
mysql&gt; select id, GROUP_CONCAT(status separator ',') as status, c_lan, Java_lan, Dot_lan
    -&gt; from foo
    -&gt; group by id
    -&gt; ;
+------+---------+-------+----------+---------+
| id   | status  | c_lan | Java_lan | Dot_lan |
+------+---------+-------+----------+---------+
|    1 | 111,222 | yes   | Q        | W       |
|    2 | 555     | yes   | Q        | W       |
+------+---------+-------+----------+---------+
2 rows in set (0.01 sec)

mysql&gt;