从2个表中检索具有相似值的字段? [英] Retrieve fields with similar values from 2 tables?
问题描述
Hiya,
如何从2个表中检索具有相似值的字段?
我试图使用
(1)SELECT * FROM $ table1 as o,$ table2 as p WHERE o.name like
''%p。name%''" ;;
但它根本没有检索。
(2)" SELECT * FROM $ table1 as o,$ table2 as p WHERE o.name like p.name" ;;
只会检索完全匹配,但这不是我想要的。
(3)SELECT * FROM $ table1 as o,$ table2 as p WHERE o .name LIKE CONCAT(''%'',
p.name,''%'');
只会检索完全匹配。
任何建议都会受到赞赏。
PostScript:我在mysql组中发布了以上内容,但问题仍然存在,所以我是
尝试我的运气好。
TIA
table1为o,
< blockquote> table2 as p WHERE o.name like
''%p.name%' ;
但它根本没有检索。
(2)" SELECT * FROM
table1 as o,
Hiya,
How do i retreive fields with similar values from 2 tables?
I tried to use
(1) "SELECT * FROM $table1 as o , $table2 as p WHERE o.name like
''%p.name%''";
but it retrieves nothing at all.
(2) "SELECT * FROM $table1 as o , $table2 as p WHERE o.name like p.name";
will retrieve exact matches only, but this is not what i want.
(3) SELECT * FROM $table1 as o , $table2 as p WHERE o.name LIKE CONCAT(''%'',
p.name, ''%'');
will retrieve exact matches only.
Any advice will be appreciated.
PostScript: i posted the above in mysql groups, but problem remains, so am
trying my luck here.
TIA
table1 as o ,
table2 as p WHERE o.name like
''%p.name%''";
but it retrieves nothing at all.
(2) "SELECT * FROM
table1 as o ,
这篇关于从2个表中检索具有相似值的字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!