Delphi實現:SQL交叉表復合查詢問題?
SQL表:Workplan,Function,Repaircode,RepairStation,ErrorCode,RootCause
工單表[Workplan]:
WorkID WorkOrder SN Model F1 F1Alias F2 F2Alias F3 F3Alias ...
1 123456 73E0001 N12 1 SMT 1 PTH 1 DIP ...
.... ...... ..... ... .. ... .. ... ... ... ...
說明:WorkID為自動增加,WorkOrder為工單號碼,SN為流水號碼,Model為機種名稱,
F1為測試站(預設值為0),F1Alias為測試站別名.....依次類推.
測試站表[Function]:
workorder functioncode scanno counts
123456 F1 73E0001 1
123456 F1 73E0002 0
123456 F2 73E0001 1
.... ... ..... .....
說明:WorkOrder為工單號,functioncode為測試站別,scanno為序列號,counts為不良次數,這是測試站,如有不良就會送到維修站去維修.
維修站表[RepaiStation]:
workorder functioncode scanno errorcode repaircode location
123456 F1 73E0001 1 1 R1
123456 F2 73E0002 4 2 C1
123456 F3 73E0001 2 1 R2
.... .... .....