* [misc,0.1h] add sub query function.

This commit is contained in:
tianshujie
2024-07-31 09:48:35 +08:00
committed by 王怡栋
parent 553ff2359b
commit 4753bfc150
+18
View File
@@ -2342,6 +2342,24 @@ class baseSQL
return $this;
}
/**
* 创建子查询'NOT IN'部分。
* Create subquery not in part.
*
* @param string|dao
* @access public
* @return static|sql the sql object.
*/
public function subNotIn($subquery)
{
if($this->inCondition and !$this->conditionIsTrue) return $this;
if(!is_string($subquery)) $subquery = $this->dbh->formatSQL($subquery->processSQL());
$this->sql .= ' NOT IN (' . $subquery . ')';
return $this;
}
/**
* 创建LIKE部分。
* Create the like by part.