• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 132
  • 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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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