Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
yukiever
Starting Member
13 Posts |
Posted - 2011-02-15 : 15:55:30
|
Hi everyone,This query seems to be hard for me. Need help.I am basically inserting to a table name: maintitemtypeOnly two columns are inserted: type, name'type' column should be always: 'Manufacturer''name' column should be a select statement:SELECT DISTINCT manufacturer FROM MaintItemType WHERE manufacturer is not nullI got something here but not working.Thanks in advance!INSERT INTO maintitemtype(type,name) values('Manufacturer')SELECT DISTINCT manufacturer FROM MaintItemType WHERE manufacturer is not null |
|
|
jimf
Master Smack Fu Yak Hacker
2875 Posts |
Posted - 2011-02-15 : 17:06:15
|
| Almost!INSERT INTO maintitemtype(type,name) SELECT DISTINCT 'manufacturer', manufacturer FROM MaintItemType WHERE manufacturer is not nullJimEveryday I learn something that somebody else already knew |
 |
|
|
yukiever
Starting Member
13 Posts |
Posted - 2011-02-15 : 17:09:15
|
quote: Originally posted by jimf Almost!INSERT INTO maintitemtype(type,name) SELECT DISTINCT 'manufacturer', manufacturer FROM MaintItemType WHERE manufacturer is not nullJimEveryday I learn something that somebody else already knew
Thanks Jim.It's working. |
 |
|
|
|
|
|