• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 229
  • Last Modified:

MySQL Hide Specific Characters from Query

I'm trying to run a query that returns a VARCHAR field that may or may not contain the characters ***. If it does contain that, I basically want to hide the 3 characters and display the rest of the string. I was trying to get the syntax below to work, but for some reason it doesn't. Any help please? Thanks!


SELECT Field1 = REPLACE(Field1,'***','') AS Test FROM `tbl_Data` WHERE ID=33

Open in new window

0
brendan-amex
Asked:
brendan-amex
1 Solution
 
dirknibleckCommented:
Is this specific query the issue, because if it is, the "Field1 =" part is probably your problem. Try:
SELECT REPLACE(Field1,'***','') AS Test FROM `tbl_Data` WHERE ID=33

Open in new window

0
 
brendan-amexAuthor Commented:
Oops, yep. That was it. Easy 500 points. Thanks.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now