現在有以下sql陳述句,在sequelize中給如何查詢,很郁悶,希望大佬們幫忙解決
TFile:檔案表 tf
TFType:檔案型別表 tft
TUser:用戶表 tu
TModel:模塊表 tm
TOption:操作日志 to
select tf.name, tu.tu_id ,tu.name, tft.name, coalesce(options.count,0) as count, tr.item, tf.module, tm.name from
"TFile" tf
left outer join
"TFType" tft on tf.tf_id = tft.tft_id
left outer join
"TUser" tu on tf.owner = tu.tu_id
left outer join
"TRole" tr on tr.tr_id = tu.tr_id
left outer join
"TModel" tm on tm_id = tf.module
left outer join
(select COUNT(tf_id) as count, tf_id from "TOption" where option_tye = 1 group by tf_id) options
on options.tf_id = tf.tf_id
where tf.module = any(tr.item)
uj5u.com熱心網友回復:
沒用過這個,不過推薦個中文檔案:https://itbilu.com/nodejs/npm/41qaV3czb.html轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/57343.html
標籤:PostgreSQL
上一篇:資料備份問題
