Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

SQL Query


  • Please log in to reply

#1
Gamer2bn

Gamer2bn

    Member

  • Member
  • PipPip
  • 48 posts
alright my issue is I have a database 'D' with a table 'T' in this table i have a column 'C' all the entries in this column are set to Null but i need them to be set to 1 I can't seem to figure out how to make a query to do this as i have never played with sql queries before please someone help me out im so frustrated and to do it manually i would have to type down 1 over 200k times.

UPDATE T
SET C = '1'
WHERE C = ''

Don't know what goes in the quotes for where to signify null tried 0 and null and a couple other things don't even know if any of what i wrote is right as i dont know sql...

Edited by Gamer2bn, 12 November 2006 - 05:14 PM.

  • 0

Advertisements


#2
mpfeif101

mpfeif101

    Member 1K

  • Retired Staff
  • 1,411 posts
UPDATE T SET C = 1 WHERE C = ''

try that...
  • 0

#3
girish_hk

girish_hk

    New Member

  • Member
  • Pip
  • 2 posts
hi,
the command is...

UPDATE T SET C=1 WHERE C IS NULL; // if C is numeric

UPDATE T SET C='1' WHERE C IS NULL; // if C is varchar
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP