在写sql的时候可能会出现以下sql语句:
select a.name,b.age from TableA a left join TableB b on a.id=b.id
如果这是HQL,那么这段代码就是错误的,因为HQL不支持ON这个字符,如果要做关联关系就必须将On改为where:
select a.name,b.age from TableA a left join TableB b where a.id=b.id
在写sql的时候可能会出现以下sql语句:
select a.name,b.age from TableA a left join TableB b on a.id=b.id
如果这是HQL,那么这段代码就是错误的,因为HQL不支持ON这个字符,如果要做关联关系就必须将On改为where:
select a.name,b.age from TableA a left join TableB b where a.id=b.id