Avatar of Web IT
Web IT

asked on 

Filter mysql result after certain text (regex)

Note:The table itsels is irrelavent to the question and as such it's not posted. (becuase the query is correct).

My question is :
Is there an SQL way to filter (such as regex) only select (not to update the table just display when queried)
out everything after the pipeline.



1) I only want to display/query not update the query results/
Here is the query result (which is working fine and the output is what should be outputed)   the "pipe " /  "|" delimiter is not another column
I will repeat again so it's not confusing
the "pipe " /  "|" delimiter is not another column it's one string.

3)The query

SELECT meta_value FROM wp_postmeta WHERE meta_key LIKE 'etimeclockwp-in%'

2)  the output (this is one column).
1576486935|8
1576141273|21
1574067745|23

3) Sample output after the questioned query  :
1576486935
1576141273
1574067745

Thank You.
MySQL ServerSQL* php mysqli connection

Avatar of undefined
Last Comment
Web IT
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

not quite sure if I understand your requirement but it seems that you want to do a like match within the content of field that contain "|" ?

try provide some sample data and tell us your expected output.
Avatar of Web IT
Web IT

ASKER

I updated my question with the sample  output.
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Web IT
Web IT

ASKER

This query works thank you !
I did see the substring but was having syntax issues.
Thanks alot.
SQL
SQL

SQL (Structured Query Language) is designed to be used in conjunction with relational database products as of a means of working with sets of data. SQL consists of data definition, data manipulation, and procedural elements. Its scope includes data insert, query, update and delete, schema creation and modification, and data access control.

61K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo