Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL statment

Status
Not open for further replies.

davidmcolaco

Technical User
Aug 1, 2005
102
PT
Hi,
I have a table with data from costumers, but now I had a new field called "state". What I need now is to fill up that field with some parameters.
For example, I want to make an sql statement that says if the city is lisbon, amadora or cascais, the state is lisbon and so on.
How can I do that?

Thanks in advance.
 
Something like this (SQL code) ?
UPDATE yourTable
SET [state] = 'lisbon'
WHERE [state] Is Null
AND city In ('lisbon', 'amadora', 'cascais')

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
It's helping a lot.
Just one more question.

If I want to insert the state by the phone numbers, how can I tell him to look in numbers started by 214 for example.

Thanks.
 
Like '214*'

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top