当前我的查询如下所示:
SELECT * FROM suppliers s INNER JOIN supplier_addresses a ON s.id = a.supplier_id
在 supplier_addresses 有一个字段叫做 address 我想用字符长度大于10的地址过滤上面查询的结果?我试图补充 where LEN(a.address) > 10 上面的问题,但没有工作。。
supplier_addresses
address
where LEN(a.address) > 10
wz8daaqr1#
它应该看起来像:
SELECT * FROM suppliers s INNER JOIN supplier_addresses a ON s.id = a.supplier_id WHERE char_length(a.address) > 10
e0bqpujr2#
您的查询应该是:
SELECT * FROM suppliers s INNER JOIN supplier_addresses a ON (s.supplier_id = a.supplier_id) WHERE LENGTH(a.address)>10;
2条答案
按热度按时间wz8daaqr1#
它应该看起来像:
e0bqpujr2#
您的查询应该是: