我有三张桌子
private static final String DTReasonTable = "create table tb_DTReasons(DTReasonId integer primary key autoincrement,DTReason text)";
private static final String ConfigurationTable = "create table tb_Config(ConfigId integer primary key autoincrement," +
"RawMaterialName text,OutPut_pdt text,TotalWorkHrs real,Quantity real,ProcessStartTime real,OutputQuantity real,procesEndTime real)";
private static final String DownTimeTable = "create table tb_DownTimeTable(DT_Id integer primary key autoincrement,ConfigId integer," +
"StartTime real,EndTime real,DTReasonId integer)";
我想创建一个如下所示的报告
谁能帮我写一个相应的报告生成程序?
public Cursor getDtAnalysisReport()
{
return this.data.rawQuery("select EndTime-StartTime as duration,tb_DTReasons.DTReason,count(tb_DownTimeTable.DTReasonId) from tb_DownTimeTable" +
" inner join tb_DTReasons on tb_DownTimeTable.DTReasonId = tb_DTReasons.DTReasonId group by tb_DownTimeTable.DTReasonId ", null);
}
这是我尝试过的,但出现错误。请帮我找到解决方案。