I want a query for the the phone number in the database are like this 47407 and i want add 2 for the all the phone nubmers. it is clear i think i want add one number.
Printable View
I want a query for the the phone number in the database are like this 47407 and i want add 2 for the all the phone nubmers. it is clear i think i want add one number.
Do u wan to add 2 or concadinate 2 to the existing value ?
What is the data type of the phone number field in the table ?
select to_char('2'||phone) from <tablename>;
I think "sravanvellala" wants to a digit ‘2’ is to be suffixed to the numbers. :confused:
Use this command… to update all rows of the table. :D
If it is a text field…
[B]UPDATE <TableName> SET <Phone> = ‘2’ & <Phone>[/B]
If it is a numeric field…
[B]UPDATE <TableName> SET <Phone> = <Phone> + 2 * (100000)[/B]
This is for a 5 digit phone number like in ur example 47407. :)
I will have to come back to this thread with a generic query for a numeric field. :D