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 1026793
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:08:16+00:00 2026-05-16T12:08:16+00:00

Say I wanted to perform an update in a database that held information on

  • 0

Say I wanted to perform an update in a database that held information on for example cars in a table by that same name.

The update I am looking to perform consists in changing the designation in the table in model from “Ford” to “Ford-” i.e. only changing where the designatin is “Ford” and not in those that already have a model designation of “Ford-”

By running the below SQL query will I get the result I expect ?

UPDATE cars  

SET model='Ford-' WHERE model='Ford'    

This in my opinion should update only instances of cars where the model designation is “Ford” and change those to “Ford-” and would not proceed to try to update anything where the designation is “Ford-” already as well, or what ?

If it does I was thinking if there is a pure SQL query structure that could be used to ensure that only cars with model = “Ford” was changed and not cars with model = “Ford-”

I am asking as I am uncertain on the way SQL would identify the search string “Ford” in the query above i.e. will SQL look for an exact match, or will the existence of the word “Ford-” in model trigger a “false positive” ? Have not done SQL queries for years.

Don’t talk about normal forms or the like, I am not responsible for creating the DB/tables etc. I am just looking into possibly cleaning up some of the information in the DB.

The table cars looks like this:

  
cars  
'id', 'int(10) unsigned', '', 'PRI', '', 'auto_increment'  
'something0', 'varchar(50)', '', 'UNI', '', ''  
'something1', 'varchar(50)', 'YES', '', '', ''  
'something2', 'varchar(50)', 'YES', '', '', ''  
'something3', 'text', 'YES', '', '', ''  
'something4', 'text', 'YES', '', '', ''  
'something5', 'varchar(50)', 'YES', '', '', ''  
'something6', 'varchar(50)', 'YES', '', '', ''  
'something7', 'varchar(15)', 'YES', '', '', ''  
'model', 'varchar(255)', 'YES', '', '', ''  

Comments are very welcome

  • 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-05-16T12:08:17+00:00Added an answer on May 16, 2026 at 12:08 pm

    You are correct:

    ... WHERE model='Ford'
    

    is an exact match (only matches “Ford”, doesn’t match “Ford-“). For a substring match, you’d use

    ... WHERE model LIKE 'Ford%'
    

    (matches anything that starts with “Ford” – but that’s apparently not what you want).

    See the documentation for UPDATE and WHERE.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Let's say I wanted to have an application that could easily switch the DB
As an example, lets say I wanted to list the frequency of each letter
I wanted to make a special version of shared_ptr that would perform specific operations
Say I wanted to have a project, and one-to-many with to-do items, and wanted
Lets say I wanted to scrape a webpage, and extract some data. I'd most
Let's say I wanted to make a python script interface with a site like
What's the best/most efficient way to extract text set between parenthesis? Say I wanted
Let's say I woke up today and wanted to create a clone of StackOverflow.com,
i'm wanted to perform some ajax calls in a certain way. I have a
How Good are broadcast intent` in terms of say I wanted to fire broadcast

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.