I use the query
Select t1.name as first, t2.name as second From products t1, products t2
that creates two columns like below. (A,B are for explaining purposes)
Before the query
-name-
A
B
C
D
E
After the query
-first- -second-
A A
B A
C A
D A
E A
A B
B B
C B
D B
E B
How to check if a row of the first column is similar to the second ?
UPDATE
I run mySQL
With similar, I mean like to find their similarity percentage are more of a specified value. Like if the first contains this is a string
and second i wear a string
there is a percentage of similarity. If this % is more than 70 then they are similar.
there are many ways, here is one that will give you all the products that match your criteria (first = second)
SELECT
t1.name AS first, t2.name AS second
FROM
products t1, products t2
WHERE
t1.name = t2.name
or, if you need all the values
Select
t1.name as first t2.name as second, (if t1.name = t2.name THEN 1 ELSE 0) as match
From
products t1, products t2
OK, here's what to do.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.