If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > insert value 1 into customer table column stand (was "Very Basic Sql")

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-14-06, 05:04
boing boing is offline
Registered User
 
Join Date: Jan 2005
Posts: 30
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
Reply With Quote
  #2 (permalink)  
Old 07-14-06, 07:15
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
Code:
insert
  into customer (stand)
values (1)
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 07-14-06, 08:55
boing boing is offline
Registered User
 
Join Date: Jan 2005
Posts: 30
how do i tell it to only insert that into blank values?
Reply With Quote
  #4 (permalink)  
Old 07-14-06, 08:59
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,524
ah, you're probably thinking of UPDATE, not INSERT
Code:
update customer
   set stand = '1' 
 where stand = ' '
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 07-14-06, 09:11
boing boing is offline
Registered User
 
Join Date: Jan 2005
Posts: 30
Thanks, i will give that a try
Reply With Quote
  #6 (permalink)  
Old 07-26-06, 04:54
boing boing is offline
Registered User
 
Join Date: Jan 2005
Posts: 30
why has someone gone and changed the title of my post?
Reply With Quote
  #7 (permalink)  
Old 07-26-06, 05:56
Littlefoot Littlefoot is offline
Lost Boy
 
Join Date: Jan 2004
Location: Croatia, Europe
Posts: 3,629
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 06:00.
Reply With Quote
  #8 (permalink)  
Old 07-26-06, 09:40
boing boing is offline
Registered User
 
Join Date: Jan 2005
Posts: 30
Ok thanks for the information
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On