?
Solved

MySQL Update question

Posted on 2011-09-10
9
Medium Priority
?
319 Views
Last Modified: 2012-05-12
UPDATE `URL` SET `Column`=1 WHERE `Top Level Category`='Cat1'
AND  `Page Category`='Cat2' AND  `Group Category`='Cat3'

Open in new window

Can you fix this MySQL statement? I need it to work in PHPMyAdmin.
0
Comment
Question by:phat_code
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
9 Comments
 
LVL 30

Expert Comment

by:hnasr
ID: 36517261
What warnings are you getting?

Is the value 1 or '1'?
0
 
LVL 84

Expert Comment

by:Dave Baldwin
ID: 36517277
There nothing wrong with your SQL unless it doesn't match your table.  @hnasr is asking whether it should be the number 1 (without quotes) or the character '1' (with quotes).
0
 

Author Comment

by:phat_code
ID: 36517347
its number 1
0
Docker-Compose to Simplify Multi-Container Builds

Our veteran DevOps Author takes you through how to build a multi-container environment, managed with a single utility in order to simplify your deployments.

 

Accepted Solution

by:
phat_code earned 0 total points
ID: 36517369
UPDATE  `URL`
SET `Column`=1 
WHERE  `Top Level Category` LIKE  'cat1'
AND  `Page Category` LIKE  'cat2'
AND  `Group Category` LIKE  'cat3'

Open in new window

Fixed it.
0
 

Author Closing Comment

by:phat_code
ID: 36541472
Found the Answer.
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 36517613
@phat_code: that doesn't make much sense as LIKE 'literal w/o wildcard' acts the same as = 'literal w/o wildcard'; therefore, it must be something with data types of the fields maybe? Not disputing the closure or that you solved this by the way. I am happy you figured it out. My concern is if you are going to leave this in the PAQ, it would be great for future readers to truly understand the solution, i.e., if using TEXT columns use ... or something to that effect.
0
 

Author Comment

by:phat_code
ID: 36518851
Not sure what you mean Text columns? And who do I give the points too also why didn't it work with equal signs?
0
 

Author Comment

by:phat_code
ID: 36518860
I am using PHP MyADMIN maybe thats the problem???????????????
0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 36519131
You give the points to your own comment as you did to answer the "who do I gives to" question. What I meant by TEXT columns is what is the data type of the columns `Top Level Category`, `Page Category`, `Group Category`. It may have to do with their type. I threw out TEXT as an example. If you don't know, then that is fine. I was just making the point that "why didn't it work with equal signs?" isn't clear from the information in the question. Not an issue for you really, so again no worries if you don't know.

Regards, Kevin
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question