Skip to content
Advertisement

Tag: sql-insert

Insert row into an empty table with INSERT … SELECT … FROM command in SQL

I’m going to make a new table (PersonInformation) with columns of another one(Members) and some more columns like “Username”, “Password” and “PersonId”. The command I used is: ‘INSERT INTO myTable(Columns_in_PersonInformation…) SELECT (Columns_in_Members + new_columns) FROM Members, PersonInformation WHERE Members.id = PersonInformation.PersonId’ I have two problems, the first one when the PersonInformation table is empty. The result is “0 rows affected”

Advertisement