我想使用ActiveQuery从SQLite数据库中选择字段,其中两列具有相等的非空值。
我需要这样生成的SQL作为示例:
SELECT * FROM messages WHERE msg_sent = 0 AND file_size = downloaded_size AND file_sha1 = downloaded_sha1
答案 0 :(得分:1)
我已经要求这样的解决方案了:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" charset="utf-8" >
var headtg = document.getElementsByTagName('head')[0];
var divElm = document.createElement('div');
var scpt = document.createElement('script');
scpt.type = 'text/javascript';
var clName= "TEST";
divElm.className = "ABC_" + clName; divElm.appendChild(scpt);
headtg.appendChild(divElm);
function innercode(i) {
var a = i; var b = a;
}
function (d) {
//codes }(document));
}
</script>
</head>
<body>
</body>
</html>
答案 1 :(得分:0)
假设您将activeRecord类命名为MyModel
$models = MyModel::find()
->where(['msg_sent'=> 0,
'file_size'=>'downloaded_size',
'file_sha1' =>'downloaded_sha1'])
->all();
如果不使用散列格式,您可以将文字格式用作
$models = MyModel::find()
->where('msg_sent = 0 and file_size= downloaded_size and file_sha1 = downloaded_sha1')
->all();