2011-07-15 4 views
1

返す方法文字列を除外するquery string it self。mysql distinctを選択すると自己照会を除外します

column string = AAA/BBB/CCC 
result string = BBB/CCC where column like AAA 



column string = AAA/BBB/CCC 
result string = CCC where column like AAA/BBB 


"SELECT DISTINCT `column` FROM `table` WHERE `column` like '???'"; 

ありがとうございます。

答えて

1
select distinct replace(column, 'AAA/BBB/', '') as column 
from table 
where column like 'AAA/BBB/%'; 
+0

ありがとうございました。 – njai

関連する問題