Mysql check if column in a row is contained in another column?

Jonathan

I'm trying to make a mysql query that checks if a column in a row is contained within another column in the same row. Is there a way to do that kinda of query?

for example:

Key        Value         runHash  
2500       tacos         night.2500.293849284 
1775       windows       day.176555.43035842

I am trying to write a query that will return the second row and not the first because for the first row, Key is in runHash.

I tried to do:

select * from table where key not in runHash

However this doesn't appear to be valid for mysql.

Gordon Linoff

You are looking for like:

where runHash like concat('%', key, '%')

You can put periods in the pattern as well, if those are important for your pattern matching.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Check if string in one column is contained in string of another column in the same row and add new column with matching column name

Python Pandas: Check if string in one column is contained in string of another column in the same row

Pandas dataframe: Check if regex contained in a column matches a string in another column in the same row

How to check if values in one dataframe column are contained in another entire column?

MYSQL query check if ID exist and copy column row values to another table related column names

How to check if value of one column is in another column of another row

Check if an element is contained in the values ​(array) of a json column in MySql

Two datasets: How to check if the values of a column of a dataset are contained in another column of another dataset in R?

How to check if a row does not exist in another column?

Pandas:check values in column A contained in column B

Find column value contained in another column R

MySQL Where column contained in string

MYSQL:Selecting SUM of a column but the column is based of another row ID

MySQL, apply a function on one column and then update another column for each row

MySQL - Pivot row values into column groups based on value of another column

MySQL: check if a column has values based on another column

check if a column contains ALL the values of another column - Mysql

Column as row concatenated with another column

Check Column By another Column and Table

Flutter Align not working inside row contained in column

Creating a Column from a Specific Value Contained in a Row

Check if certain value is contained in a dataframe column in pandas

Check if a group of values is contained in a column in SQL Server

Delete a Value if it is not contained in another Column, in R

Print the value of a column in a dataframe that is not contained in another dataframe

Append column value if string is contained in another string

Google Sheets: Check if any values exist in another column for each row

Check if values are the same for each row over a critiera in another column

Check previous row value to copy data from one column to another