Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8919203
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:57:35+00:00 2026-06-15T05:57:35+00:00

I have the following SQL which I have written to update a tables values:

  • 0

I have the following SQL which I have written to update a tables values:

Update Table
SET S_Type = 'Versus'
Where S_Type = 'REGULAR'
SET S_Type = 'Free'
Where S_Type = 'CASH';

My SQL is rather rusty, and my colleague told me something was up with it but didn’t tell me what!

The only thing that comes to mind is I have not referred to the Table.Column in the set and Where code.

Is there any issue updating a column as such? What is the best practice when updating a column for multiple values?

Cheers

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T05:57:36+00:00Added an answer on June 15, 2026 at 5:57 am

    Here , we are using case statement and find result like as where clause :

    update tablename
    set S_Type = (case S_Type  when 'REGULAR' then 'Versus'
                               when 'CASH' then 'free' 
                               else s_type 
                               end)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an sql table which has the following rows. (4081, 3, '', 'contrapreneurship.jpg',
I have the following SQL statement which has a very bad performance: SELECT frmInstLastModifiedDate
I have following somewhat complex sql query which has horrible performance, 'certainly' due to
I have a drop-down list which is generated based on the following sql query:
I have the following piece of SQL: select DATEADD(s,-1,DATEADD(mm, DATEDIFF(m,0,GETDATE()),0)) which comes through as
I have the following which works in SQL Query Analyzer . select oh.* from
I have written the following SQL statement in MySQL : USE my_database; SELECT *
I have the following SQL which creates a friends list with other info: SELECT
I have the following sql which returns Projects and related Contractors as well as
There is a problem in which i have to update a table with millions

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.