Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2002-07-23 : 08:55:23
|
| vamsi writes "Well i have written a query using the left and the charindex function to return the country_names of a particular number by extracting the country code from phone numbereg: if the phone number is 1-800-8269 the query will return america by extracting the 1 from the number and passing the number to a different table where i have the country names and the country codes. i should get the result in the following manner asName duration Phone_number Countryjohn 30 1-800-8269 USAlinda 100 91-897-54585 indiai have two different tables in one table the information is like name dur phone_number ratejohn 30 1-800-8269 50linda 100 91-897-54585 150the other table ccode country1 USA91 India44 UKHow do i do that ??" |
|
|
RickD
Slow But Sure Yak Herding Master
3608 Posts |
Posted - 2002-07-23 : 09:19:59
|
| Looks up JOIN in BOLPeaceRick |
 |
|
|
joldham
Wiseass Yak Posting Master
300 Posts |
Posted - 2002-07-23 : 09:47:20
|
| A further hint is in your join statement, user your left(column,charindex()) function = ccode from the other table.Using an join and the above, you should be able to accomplish want you need.Jeremy |
 |
|
|
|
|
|