Skip to main content
added 330 characters in body
Source Link
aasanchez
  • 169
  • 1
  • 2
  • 17

The SQL Insert dont accept where parameters, you could check this: SQL Insert Definition...

I do not know the whole question of what you want to do, but just using the INSERT statement is not possible, however it is possible to condition the insertion of data into a table, if this data is dependent on another table or comes from another table ... check here... SQL Insert explain in wikipedia

like this:

Copying rows from other tables

INSERT INTO phone_book2
SELECT *
FROM   phone_book
WHERE  name IN ('John Doe', 'Peter Doe')

or

INSERT INTO phone_book2 ( [name], [phoneNumber] )
SELECT [name], [phoneNumber]
FROM   phone_book
WHERE  name IN ('John Doe', 'Peter Doe')

The SQL Insert dont accept where parameters, you could check this: SQL Insert Definition...

I do not know the whole question of what you want to do, but just using the INSERT statement is not possible, however it is possible to condition the insertion of data into a table, if this data is dependent on another table or comes from another table ... check here... SQL Insert explain in wikipedia

The SQL Insert dont accept where parameters, you could check this: SQL Insert Definition...

I do not know the whole question of what you want to do, but just using the INSERT statement is not possible, however it is possible to condition the insertion of data into a table, if this data is dependent on another table or comes from another table ... check here... SQL Insert explain in wikipedia

like this:

Copying rows from other tables

INSERT INTO phone_book2
SELECT *
FROM   phone_book
WHERE  name IN ('John Doe', 'Peter Doe')

or

INSERT INTO phone_book2 ( [name], [phoneNumber] )
SELECT [name], [phoneNumber]
FROM   phone_book
WHERE  name IN ('John Doe', 'Peter Doe')
Source Link
aasanchez
  • 169
  • 1
  • 2
  • 17

The SQL Insert dont accept where parameters, you could check this: SQL Insert Definition...

I do not know the whole question of what you want to do, but just using the INSERT statement is not possible, however it is possible to condition the insertion of data into a table, if this data is dependent on another table or comes from another table ... check here... SQL Insert explain in wikipedia