在 2009-06-14日的 14:50 +0100,Simon Slavin写道:
> On 14 Jun 2009, at 2:23pm, Kermit Mei wrote:
> 
> > I want to create a new table, its primary key is an int 'id' column,  
> > but
> > I don't want to insert the data by hand, I hope the system can  
> > generate
> > it by adding id.
> >
> > For example,
> > mytable(id, name, age)
> >
> > When I insert name and age, the id is generated automatically.
> 
> Just don't mention the id column when you insert data:
> 
> INSERT INTO mytable (name, age) VALUES ('Frank', 18)
> 
> > How can I import data from a file, and SPECIFY the column?
> 
> The above might answer your question, but if it doesn't, we probably  
> need to know how you are doing your importing: are you writing your  
> own software or using a tool we're all familiar with ?
> 
> Simon.
 Thank you, Simon. But I want to insert values from a file underlinux,
and I don't want write any code for it. I hope sqlite3 > .import FILE
can do it:)

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to