0
2つの異なるテーブルから集計データを取得する必要があります。フォーマットDjangoからの連合クエリORM
element_type count
xyz 2
pqr 1
users 3
SQLクエリの例は次の
Elements
element_type tempcolumn
xyz test1
pqr test2
xyz test3
Users:
User_names
auser
buser
cuser
必要出力:
SELECT element_type, count(*)
FROM Elements group by element_type
union
select 'users',count(*) from Users
たちはDjangoのORMと同じexcuteことができますか?