Click here to Skip to main content
15,914,447 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Below is my query i need to set the value for Grade_code similar as name
SQL
SELECT PR_GRADE_MASTER.NAME, PR_GRADE_MASTER.GRADE_CODE, PR_GRADE_MASTER.ACTIVE, PR_GRADE_MASTER.PROB_PERIOD,
 PR_GRADE_MASTER.LEVEL_NO, PR_GRADE_MASTER.UNION_MEM,PR_GRADE_MASTER.NOTICE_PERIOD,
 PR_GRADE_MASTER.NOTICE_PERIOD_PROB,PR_GRADE_MASTER.MIN_AGE,PR_GRADE_MASTER.MAX_AGE,PR_GRADE_MASTER.ASC_NOTICE_PERIOD,
                           PR_CATEGORY_MASTER.ID PR_CATEGORY_MASTER_ID,
                           PR_CATEGORY_MASTER.NAME CATEGORY_NAME
                           FROM
                            (PR_GRADE_MASTER LEFT OUTER JOIN PR_CATEGORY_MASTER ON
                            PR_GRADE_MASTER.PR_CATEGORY_MASTER_ID = PR_CATEGORY_MASTER.ID)
                             WHERE  PR_GRADE_MASTER.ID= 1 FOR UPDATE set             PR_GRADE_MASTER.GRADE_CODE = 'GRADE1'

but the above query is giving error : missing or invalid option.


PR_GRADE_MASTER was already created i just added the column GRADE_CODE , now for my previous record in PR_GRADE_MASTER i want to update the GRADE_CODE value from Name
Posted
Updated 3-Jun-14 21:15pm
v2

1 solution

Hi,

Since i am not clear about your 2 table from which you want to update data in GRADE_CODE of PR_GRADE_MASTER table. Kindly replace the required table name / column name / where conditions in below query.

SQL
update PR_GRADE_MASTER
set
GRADE_CODE='Your 2nd Table.Required Col'
from
'Your 2nd Table'
where
'Matching cols conditions'



Hope this will help you.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900