Sunday, 15 January 2012

sql - Split first name and last name of a person, stored as one field -



sql - Split first name and last name of a person, stored as one field -

so explained situation :

i got table, old datas, containing tutors.

it's identity stored 1 field.

some samples :

le raie jean martin jean-michel bernard-dubois jacques

all info on 1 field, while should more :

name | firstname le raie | jean martin | jean-michel bernard-dubois | jacques le raie | jean jacques

as can see, lastly name can in 2 parts, space, -.

same first name.

i must absolutly have first name in same field, rest firstname field.

and don't see, can wrote it.

because there can no separator, space or -, don't see how it, without impact on first name part.

i think using substring, rules should utilize it?

for now, have select statement :

select decode(id_agent, null, 0, id_agent ), matricule, decode(id_agent, null, '0', '1' ), decode(id_agent, null, record.identite, nom ), decode(id_agent, null, record.identite, prenom ) v_nbnum, v_matricule, v_flagactif, v_nom, v_prenom t_agent;

i hope have been clear. did got ideas?

sql oracle10g

No comments:

Post a Comment