select distinct substr(value,2,4),summary
from ticket_custom
LEFT JOIN ticket On ticket_custom.substr(value,4) = ticket.id
where name = "parent" AND value <> 0
我有一个表ticket_custom,其中票证号在票证号前面有一个hastag(例如“#4567”),但是在表票证中,票证号没有此井号(“ 4567”)被保存。 我想离开这两个表,并想在票证编号旁边使用不带#的票证的“ summary”值。我尝试了上述查询,但出现错误。我如何结合使用不带#的票证编号的substr =和左连接?还是有其他方法可以做到这一点?
谢谢!