Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
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