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

1928 у кіно

Захаров Федір Захарович

Ель Греко