J
Jose Perdigao
I would like to create a view based in a sp or another view like the
following example:
SELECT dDate, Well
FROM dbo.J1_WTzDL
WHERE (dDate = iDate())
We have results as below:
dDate
Well
10/12/2005
ALB - 4H
10/12/2005
BAG - 4L
10/12/2005
CHO - 1
10/12/2005
EST-A-2
10/12/2005
EST-B-1
Now, I would like to create a view to show the top 10 for each well from the
results above and dDate<=iDate()
The following view is not complete I don't know how I can report the top 10
for each well.
SELECT TOP 10 dDate, Well, TestGood, TestOil, TestWater
FROM dbo.J1_WTzDL
WHERE (dDate <= dbo.iDate())
ORDER BY dDate DESC
How can I create this view?
Thanks
josé perdigão
following example:
SELECT dDate, Well
FROM dbo.J1_WTzDL
WHERE (dDate = iDate())
We have results as below:
dDate
Well
10/12/2005
ALB - 4H
10/12/2005
BAG - 4L
10/12/2005
CHO - 1
10/12/2005
EST-A-2
10/12/2005
EST-B-1
Now, I would like to create a view to show the top 10 for each well from the
results above and dDate<=iDate()
The following view is not complete I don't know how I can report the top 10
for each well.
SELECT TOP 10 dDate, Well, TestGood, TestOil, TestWater
FROM dbo.J1_WTzDL
WHERE (dDate <= dbo.iDate())
ORDER BY dDate DESC
How can I create this view?
Thanks
josé perdigão