Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这个查询
SELECT t1.*, t2.* FROM table1 AS t1 LEFT JOIN table2 AS t2 ON t2.id = t1.id
我想将“t1.id”(INT 类型)视为负数,所以基本上我只需在“320”之前添加“-”。我尝试过这样的事情但没有成功:
t2.id = 't1.'-'id'
我怎样才能做到?
使用简单的乘法:
t2.id = -1 * t1.id'
乘以-1
t2.id = -1 * t1.id