Jump to content

SQL query


nikhilboorla

Recommended Posts

I have 2 tables called X and Y and both tables have common field called BASELINE .When i update in X table, it replaces only the records where BASELINE != “RESOURCES”
When i update in Y table, it replaces records where BASELINE=”RESOURCES”(X table has different records other than "RESOURCES" but Y has only "RESOURCES" throughout the table )
=> How should we update each of these files when i get new data from client?

Please help me to solve this issue.

Link to comment
Share on other sites

too basic adugutnav man.. u shud google it before

 

update X set update_field = update_value where  BASELINE!=”RESOURCES”

 

update Y set update_field = update_value where  BASELINE=”RESOURCES”

Link to comment
Share on other sites

i need query to update all records where it matches condition  BASELINE =”RESOURCES” in X table

because it is updating records where  BASELINE = other fields EXCEPT RESOURCES

Link to comment
Share on other sites

1 hour ago, nikhilboorla said:

I have 2 tables called X and Y and both tables have common field called BASELINE .When i update in X table, it replaces only the records where BASELINE != “RESOURCES”
When i update in Y table, it replaces records where BASELINE=”RESOURCES”(X table has different records other than "RESOURCES" but Y has only "RESOURCES" throughout the table )
=> How should we update each of these files when i get new data from client?

Please help me to solve this issue.

then y where clause for Y table?

Link to comment
Share on other sites

2 hours ago, nikhilboorla said:

I have 2 tables called X and Y and both tables have common field called BASELINE .When i update in X table, it replaces only the records where BASELINE != “RESOURCES”
When i update in Y table, it replaces records where BASELINE=”RESOURCES”(X table has different records other than "RESOURCES" but Y has only "RESOURCES" throughout the table )
=> How should we update each of these files when i get new data from client?

Please help me to solve this issue.

Assalu nuvvu adige question neeku ayina ardam ayindha?

update table X set column=' ' where baseline not in ('RESOURCES');

update table Y set column='' where baseline in ('RESOURCES');

How should we update each of these files when i get new data from client? -

what do you mean by new data?

Do not post the questions from your work as is in this forum. First understand what exactly you need and then ask for help.

Link to comment
Share on other sites

30 minutes ago, loveindia said:

2 tables update in one condition aaa man... Kata Kata kata...

nenu cheppana two tables update  ani ...syntax motham chepala enti..basic syntax ccheppanu...table X AND Y separate ga   update cheyyi ani chepthuna 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...