Results 1 to 8 of 8
  1. #1
    Join Date
    Jan 2005
    Posts
    30

    Unanswered: insert value 1 into customer table column stand (was "Very Basic Sql")

    Hello,

    Bit of basic sql here for you:

    I have a table called "customer" and there is a field in customer called stand.

    Stand is also a seperate table that is joined to customer.

    However i would like to add the value of "1" into STAND on the CUSTOMER table and i was wondering if someone could tell me the sql to do this. So basically where there is nothing insert a value of 1 into stand on customer.

    Cheers

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Code:
    insert
      into customer (stand)
    values (1)
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Jan 2005
    Posts
    30
    how do i tell it to only insert that into blank values?

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    ah, you're probably thinking of UPDATE, not INSERT
    Code:
    update customer
       set stand = '1' 
     where stand = ' '
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Jan 2005
    Posts
    30
    Thanks, i will give that a try

  6. #6
    Join Date
    Jan 2005
    Posts
    30
    why has someone gone and changed the title of my post?

  7. #7
    Join Date
    Jan 2004
    Location
    Croatia, Europe
    Posts
    4,094
    Provided Answers: 4
    Moderator changed unapropriate title ("Very basic sql") into something more meaningful ("insert value 1 into customer table column stand"). As you can see, he indicated the original thread name.

    Read more about How to ask questions the smart way, especially "Use meaningful, specific subject header" chapter.
    Last edited by Littlefoot; 07-26-06 at 07:00.

  8. #8
    Join Date
    Jan 2005
    Posts
    30
    Ok thanks for the information

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •