Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Add 2 for all phone numbers

This is a discussion on Add 2 for all phone numbers within the SQL forums, part of the Databases category; 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 ...

Go Back   Geeks Talk > Databases > SQL
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 09-29-2007
Junior Member
 
Join Date: Sep 2007
Location: kurnool
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
sravanvellala is on a distinguished road
Add 2 for all phone numbers

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.
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 09-30-2007
Moderator
 
Join Date: Jun 2007
Location: Bangalore,India
Posts: 1,853
Thanks: 9
Thanked 168 Times in 142 Posts
debasisdas has a spectacular aura aboutdebasisdas has a spectacular aura about
Re: Add 2 for all phone numbers

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 ?
Reply With Quote
  #3 (permalink)  
Old 10-01-2007
Junior Member
 
Join Date: Jul 2007
Posts: 6
Thanks: 0
Thanked 2 Times in 2 Posts
bhavanakalia is on a distinguished road
Re: Add 2 for all phone numbers

select to_char('2'||phone) from ;
Reply With Quote
  #4 (permalink)  
Old 10-01-2007
Expert Member
 
Join Date: Nov 2006
Location: Hyd-IND
Posts: 528
Thanks: 1
Thanked 63 Times in 50 Posts
sutnarcha is on a distinguished road
Re: Add 2 for all phone numbers

I think "sravanvellala" wants to a digit ‘2’ is to be suffixed to the numbers.

Use this command… to update all rows of the table.

If it is a text field…
UPDATE SET = ‘2’ &

If it is a numeric field…
UPDATE SET = + 2 * (100000)

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.
__________________
Lack of WILL POWER has caused more failure than
lack of INTELLIGENCE or ABILITY.

-sutnarcha-

Last edited by sutnarcha; 10-01-2007 at 03:53 AM.
Reply With Quote
Reply

  Geeks Talk > Databases > SQL

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
access Internet from cell phone JobHelper Networking 1 06-18-2007 10:04 AM
Power Phone Book is an organizer of new generation. JobHelper Geeks Lounge 0 04-15-2007 06:21 AM
NUmbers smart_coder Brainteasers 4 03-30-2007 02:45 AM
Next Three numbers Manojks Brainteasers 3 01-18-2007 04:42 AM
What are the four numbers ? psuresh1982 Brainteasers 5 01-05-2007 06:48 AM


All times are GMT -4. The time now is 07:20 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved