SQL在1表中选择2列WHERE column1 LIKE column2

时间:2016-10-05 01:21:56

标签: sql ms-access

嗨,大家好我刚接触sql这是我的桌子

enter image description here

我只想选择所有相似的值。

示例输出:

AA AA U
BB BB U
DD DD

2 个答案:

答案 0 :(得分:0)

SQL小提琴: - http://sqlfiddle.com/#!6/c4564/7

 MobileAds.initialize(getApplicationContext(),getString(R.string.adMob_app_id));

答案 1 :(得分:0)

试试这个:

 SELECT charindex.symbol, (SELECT comp FROM charindex AS C2 WHERE LEFT(c2.comp,2) = charindex.symbol) AS Comp2
    FROM charindex
    WHERE ((((SELECT comp FROM charindex AS C2 WHERE LEFT(c2.comp,2) = charindex.symbol))<>""));