You should try it. The database will like it just fine as long as you have
as many values/columns  in your VALUES/SELECT clause as you list as columns
in your INSERT clause.

Just remember, though, that for all of the columns NOT listed in the INSERT
clause of your statement the database will assign those columns their
default value (which is exactly what you *want* to have happen for
auto_increment and certain timestamp columns!)

Yours,
Shawn Green
Database Administrator
Unimin Corporation - Spruce Pine




                                                                                       
                                 
                      "Scott Fletcher"                                                 
                                 
                      <[EMAIL PROTECTED]        To:       <[EMAIL PROTECTED]>          
                              
                      com>                     cc:                                     
                                 
                                               Fax to:                                 
                                 
                      06/17/2004 12:28         Subject:  Questions about MySQL's 
INSERT syntax....                      
                      PM                                                               
                                 
                                                                                       
                                 
                                                                                       
                                 




Hi!  The SQL's INSERT Syntax that have been frequently been used is

--snip--
INSERT INTO TABLE1
(COLUMN1,COLUMN2,COLUMN3,COLUMN4,COLUMN5)
VALUES
('ONE','TWO','THREE','FOUR','FIVE')
--snip--

where the TABLE1 have 5 columns, "COLUMN1, COLUMN2, COLUMN3, COLUMN4,
COLUMN5".  What I wanna know is will MySQL accept a fewer columns
instead of all, like this...

--snip--
INSERT INTO TABLE1
(COLUMN1,COLUMN3)
VALUES
('ONE','THREE')
--snip--


Because on some database software/application, it won't accept this if
the table get very long with many columns and I was forced to use all of
hte columns in the SQL Syntax.  I don't know how MySQL react to this
with a very long table and with many columns.

Thanks,
 Scott F.






-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to