• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 130
  • Last Modified:

How to set the same value for every record

I use the following Query "INSERT INTO errrequired (drawing) SELECT drawing FROM border_att". Now i want to fill another field in the "errrequired" table at the same time with a text value. Something like "INSERT INTO errrequired (drawing, attribute) SELECT drawing FROM border_att VALUES 'Drawingnr'". I don't want to loop trough every record to set the value.
0
WNE
Asked:
WNE
1 Solution
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
Simply add the constant value in the select list:
INSERT INTO errrequired (drawing, attribute)
SELECT drawing , 'Drawingnr' FROM border_att

CHeers
0
 
WNEAuthor Commented:
That i didn't think of that.

Thanks for the quick response.
0

Featured Post

[Webinar] Kill tickets & tabs using PowerShell

Are you tired of cycling through the same browser tabs everyday to close the same repetitive tickets? In this webinar JumpCloud will show how you can leverage RESTful APIs to build your own PowerShell modules to kill tickets & tabs using the PowerShell command Invoke-RestMethod.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now