Sql procedure to update a column of a table for multiple conditions as given in sample The Next CEO of Stack OverflowHow to do an update + join in PostgreSQL?Update multiple columns of a table conditionally in a single commandPostgreSQL Update Column based on Multiple ConditionsUpdate column in multiple tablesPostgreSQL CASE … END with multiple conditionsPostgreSQL 9.3: Update table without using if conditionPostgresql- select parent table rows that satisfies condition in child table with the given arraysql: update dynamic table with dynamic columns and valuesAutoGenerate a uuid and use a part of it to update another column in a single postgres query statementWhere condition for multiple columns using Sequelize and node.jsUpdate column with multiple values Postgres

Would a completely good Muggle be able to use a wand?

Why do airplanes bank sharply to the right after air-to-air refueling?

A Man With a Stainless Steel Endoskeleton (like The Terminator) Fighting Cloaked Aliens Only He Can See

Proper way to express "He disappeared them"

How to get from Geneva Airport to Metabief, Doubs, France by public transport?

Which one is the true statement?

Is there a difference between "Fahrstuhl" and "Aufzug"

Chain wire methods together in Lightning Web Components

WOW air has ceased operation, can I get my tickets refunded?

Why does the flight controls check come before arming the autobrake on the A320?

Flying from Cape Town to England and return to another province

Find non-case sensitive string in a mixed list of elements?

How to write a definition with variants?

How to edit “Name” property in GCI output?

RigExpert AA-35 - Interpreting The Information

Is it ever safe to open a suspicious HTML file (e.g. email attachment)?

How to check if all elements of 1 list are in the *same quantity* and in any order, in the list2?

Is the D&D universe the same as the Forgotten Realms universe?

Calculator final project in Python

Easy to read palindrome checker

Make solar eclipses exceedingly rare, but still have new moons

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

Is it my responsibility to learn a new technology in my own time my employer wants to implement?

How to count occurrences of text in a file?



Sql procedure to update a column of a table for multiple conditions as given in sample



The Next CEO of Stack OverflowHow to do an update + join in PostgreSQL?Update multiple columns of a table conditionally in a single commandPostgreSQL Update Column based on Multiple ConditionsUpdate column in multiple tablesPostgreSQL CASE … END with multiple conditionsPostgreSQL 9.3: Update table without using if conditionPostgresql- select parent table rows that satisfies condition in child table with the given arraysql: update dynamic table with dynamic columns and valuesAutoGenerate a uuid and use a part of it to update another column in a single postgres query statementWhere condition for multiple columns using Sequelize and node.jsUpdate column with multiple values Postgres










0















there are two tables with following columns and dataset:



 emp_details emp_value
emp_id--user_id--emp_name emp_id--user_id--emp_name_val
123 111 CR 123 111 1
124 111 Gr 124 111 2


I want to update the value of emp_name_val=3 for emp_id=124 when
emp_id=123 and emp_name_val=1.Need a procedure to update the values when there
are such multiple conditions










share|improve this question



















  • 1





    Possible duplicate of How to do an update + join in PostgreSQL?

    – Scoots
    Mar 7 at 17:11











  • It's not answered in the given question.

    – POOJA
    Mar 7 at 18:47















0















there are two tables with following columns and dataset:



 emp_details emp_value
emp_id--user_id--emp_name emp_id--user_id--emp_name_val
123 111 CR 123 111 1
124 111 Gr 124 111 2


I want to update the value of emp_name_val=3 for emp_id=124 when
emp_id=123 and emp_name_val=1.Need a procedure to update the values when there
are such multiple conditions










share|improve this question



















  • 1





    Possible duplicate of How to do an update + join in PostgreSQL?

    – Scoots
    Mar 7 at 17:11











  • It's not answered in the given question.

    – POOJA
    Mar 7 at 18:47













0












0








0








there are two tables with following columns and dataset:



 emp_details emp_value
emp_id--user_id--emp_name emp_id--user_id--emp_name_val
123 111 CR 123 111 1
124 111 Gr 124 111 2


I want to update the value of emp_name_val=3 for emp_id=124 when
emp_id=123 and emp_name_val=1.Need a procedure to update the values when there
are such multiple conditions










share|improve this question
















there are two tables with following columns and dataset:



 emp_details emp_value
emp_id--user_id--emp_name emp_id--user_id--emp_name_val
123 111 CR 123 111 1
124 111 Gr 124 111 2


I want to update the value of emp_name_val=3 for emp_id=124 when
emp_id=123 and emp_name_val=1.Need a procedure to update the values when there
are such multiple conditions







postgresql






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Mar 7 at 17:51







POOJA

















asked Mar 7 at 17:01









POOJAPOOJA

12




12







  • 1





    Possible duplicate of How to do an update + join in PostgreSQL?

    – Scoots
    Mar 7 at 17:11











  • It's not answered in the given question.

    – POOJA
    Mar 7 at 18:47












  • 1





    Possible duplicate of How to do an update + join in PostgreSQL?

    – Scoots
    Mar 7 at 17:11











  • It's not answered in the given question.

    – POOJA
    Mar 7 at 18:47







1




1





Possible duplicate of How to do an update + join in PostgreSQL?

– Scoots
Mar 7 at 17:11





Possible duplicate of How to do an update + join in PostgreSQL?

– Scoots
Mar 7 at 17:11













It's not answered in the given question.

– POOJA
Mar 7 at 18:47





It's not answered in the given question.

– POOJA
Mar 7 at 18:47












1 Answer
1






active

oldest

votes


















0














UPDATE emp_value
SET emp_name_val = 3
FROM emp_value inner join emp_details using(emp_id)
WHERE emp_id=123 and emp_name_val =1





share|improve this answer

























  • Please add some explanation to your code so others can learn from what you've done. From Review.

    – Wai Ha Lee
    Mar 10 at 0:04











Your Answer






StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");

StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55049215%2fsql-procedure-to-update-a-column-of-a-table-for-multiple-conditions-as-given-in%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














UPDATE emp_value
SET emp_name_val = 3
FROM emp_value inner join emp_details using(emp_id)
WHERE emp_id=123 and emp_name_val =1





share|improve this answer

























  • Please add some explanation to your code so others can learn from what you've done. From Review.

    – Wai Ha Lee
    Mar 10 at 0:04















0














UPDATE emp_value
SET emp_name_val = 3
FROM emp_value inner join emp_details using(emp_id)
WHERE emp_id=123 and emp_name_val =1





share|improve this answer

























  • Please add some explanation to your code so others can learn from what you've done. From Review.

    – Wai Ha Lee
    Mar 10 at 0:04













0












0








0







UPDATE emp_value
SET emp_name_val = 3
FROM emp_value inner join emp_details using(emp_id)
WHERE emp_id=123 and emp_name_val =1





share|improve this answer















UPDATE emp_value
SET emp_name_val = 3
FROM emp_value inner join emp_details using(emp_id)
WHERE emp_id=123 and emp_name_val =1






share|improve this answer














share|improve this answer



share|improve this answer








edited Mar 10 at 0:01









Wai Ha Lee

6,116124166




6,116124166










answered Mar 9 at 23:13









thomas vangoidsenhoventhomas vangoidsenhoven

1




1












  • Please add some explanation to your code so others can learn from what you've done. From Review.

    – Wai Ha Lee
    Mar 10 at 0:04

















  • Please add some explanation to your code so others can learn from what you've done. From Review.

    – Wai Ha Lee
    Mar 10 at 0:04
















Please add some explanation to your code so others can learn from what you've done. From Review.

– Wai Ha Lee
Mar 10 at 0:04





Please add some explanation to your code so others can learn from what you've done. From Review.

– Wai Ha Lee
Mar 10 at 0:04



















draft saved

draft discarded
















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55049215%2fsql-procedure-to-update-a-column-of-a-table-for-multiple-conditions-as-given-in%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Save data to MySQL database using ExtJS and PHP [closed]2019 Community Moderator ElectionHow can I prevent SQL injection in PHP?Which MySQL data type to use for storing boolean valuesPHP: Delete an element from an arrayHow do I connect to a MySQL Database in Python?Should I use the datetime or timestamp data type in MySQL?How to get a list of MySQL user accountsHow Do You Parse and Process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?Why shouldn't I use mysql_* functions in PHP?

Compiling GNU Global with universal-ctags support Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Data science time! April 2019 and salary with experience The Ask Question Wizard is Live!Tags for Emacs: Relationship between etags, ebrowse, cscope, GNU Global and exuberant ctagsVim and Ctags tips and trickscscope or ctags why choose one over the other?scons and ctagsctags cannot open option file “.ctags”Adding tag scopes in universal-ctagsShould I use Universal-ctags?Universal ctags on WindowsHow do I install GNU Global with universal ctags support using Homebrew?Universal ctags with emacsHow to highlight ctags generated by Universal Ctags in Vim?

Add ONERROR event to image from jsp tldHow to add an image to a JPanel?Saving image from PHP URLHTML img scalingCheck if an image is loaded (no errors) with jQueryHow to force an <img> to take up width, even if the image is not loadedHow do I populate hidden form field with a value set in Spring ControllerStyling Raw elements Generated from JSP tagds with Jquery MobileLimit resizing of images with explicitly set width and height attributeserror TLD use in a jsp fileJsp tld files cannot be resolved