Select to view content in your preferred language

Sort in subquery in mssql 2005

2641
0
09-15-2014 08:27 AM
PiotrSkworzec
Deactivated User

Hello,

 

i'm trying to import some data from another mssql 2005 database into my arcsde 10. I've created some python script to import that data. But now I must solve problem, which is:

- in ms sql server managment studio I've connected to that db, created sql query which is:

SELECT TOP 200 * FROM [envisql].[dbo].[sometable] WHERE [point]=100 ORDER BY [date] DESC

and it works fine.

 

Then I've connected whrough ODBC to mentioned db, then 'I've added that table to arcmap. Now when I want to show mentioned above records, I'm using definition filter like:

date IN (SELECT TOP 200 [date] FROM [envisql].[dbo].[sometable] WHERE [point]=100 ORDER BY [date] DESC)

 

It works, but it doesn't show me 200 records but ie. ~500 and not where point=100.

 

What is wrong?

0 Kudos
0 Replies