SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 Transact-SQL (2012)
 Find/Replace issue
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

salvjr
Starting Member

2 Posts

Posted - 06/14/2013 :  16:15:20  Show Profile  Reply with Quote
I want to thank everyone in advance for your assistance in this matter. I'm running MS SQL 2k. In a database called consumer there is a table called consumerdata. In the telephone column there are phone numbers, but at times some fields are null and some just contain a zero 0. I'm trying to replace the rows that contain only a 0 with nothing, but I don't want to effect a row of data that happens to contain a zero such as 9544801001 as that has to be left untouched. And ideas for a t-sql script? Also I should mention there are 160 million rows :(

Thanks everyone... Sal

Lamprey
Flowing Fount of Yak Knowledge

4614 Posts

Posted - 06/14/2013 :  16:49:14  Show Profile  Reply with Quote
UPDATE ConsumerData
SET PhoneNumber = NULL
WHERE PhoneNumber = '0'

Edited by - Lamprey on 06/14/2013 16:49:27
Go to Top of Page

salvjr
Starting Member

2 Posts

Posted - 06/15/2013 :  15:01:25  Show Profile  Reply with Quote
You are awesome! Thank you so much! Works perfectly!!
Go to Top of Page

kittu
Starting Member

1 Posts

Posted - 06/18/2013 :  03:51:08  Show Profile  Reply with Quote
For each maker, list in the alphabetical order with "/" as delimiter all the types of products he produces.
Deduce: maker, product types' list


· Help topics:
GROUP BY clause
COALESCE operator
REPLACE function
Getting summarizing values

answer my query
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

India
52317 Posts

Posted - 06/18/2013 :  03:54:56  Show Profile  Reply with Quote
quote:
Originally posted by kittu

For each maker, list in the alphabetical order with "/" as delimiter all the types of products he produces.
Deduce: maker, product types' list


· Help topics:
GROUP BY clause
COALESCE operator
REPLACE function
Getting summarizing values

answer my query



DOnt hijack threads
Post as a new thread if you've a question
In any case we wont hlep with homework/assignments unless you try it out yourself

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/
https://www.facebook.com/VmBlogs
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000