Dear All,
I need to do data mining for all Batches with Formula that were run during last 2 year on a particular UNIT. I have never tried generating the Queries before, so I am not aware of that. Recently read online about how SQL can really improve and fasten the data mining job using Queries so want to give it a try.
Any help regarding writing the query would be greatly appreciated.
Thank you.
-Ashish P
Niklas Flykt
Klinkmann Oy
Key Account Manager safety products
nikfly@gmail.com
In reply to Niklas Flykt:
In reply to Robert Rijnders:
In reply to Ashish P:
Try this. change use DVHisDB to each archive that may contains batches of interest (i.e. use archive2013, use archive2012) The trick here is formula is not associated with the batch directly, only through batch recipe parameters. Also, unit is not associated with the batch directly, only with the unit procedures or lower level items within the batch. The following query joins batch formula view and the batch recipe views on uniqueID provided the criteria in each view is met.
use DVHisDB
SELECT distinct batchformulaview.batchID
,batchformulaview.formula
,batchrecipeview.unit
FROM batchformulaview
inner join batchrecipeview
on batchformulaview.uniqueid = batchrecipeview.uniqueid
and batchrecipeview.starttime > DATEADD(year,-2,GETDATE())
where (formula = 'theFormulaname') and (unit = 'theUnitName')
In reply to Youssef.El-Bahtimy:
Best Regards,
Rachelle McWright: Business Development Manager, Dynamic Simulation: U.S. Gulf Coast