Home > database >  For help calling bosses can make these two problems
For help calling bosses can make these two problems

Time:02-10

Existing customer table 1, there are two fields: id and name, currently exist duplicate data in the table, please use an SQL delete duplicate data in the table (note: duplicate data need to retain a),
2. Also use the table above, please use the SQL will be the same id name to ", "space and joining together, two new data and the id to heavy,

(which bosses can use Sql to write out the best finally can add their thinking)

CodePudding user response:

1, delete from the customer where e "e.r owid & gt; (select min (x.r owid)
From the customer where x x.i d=e.i d);
2, select id, wm_concat (name) from custome
Group by id

A statement to delete, use the rowid; Wm_concat function, you can search the understanding, probably just like this

CodePudding user response:

Prepare test Oracle OCP, do not know how to prepare, hope to have a brother can see through my confused
  • Related