select a.t_mitm mitm, a.t_sitm sitm, a.t_cpha cpha from ttibom010 a where (a.t_mitm in (select t_sitm from ttibom010 where substring (a.t_mitm , 10, 10 ) = '2046000021' ) or substring (a.t_mitm , 10, 10 ) = '2046000021'
But I get a different problem.
this query runs in 30 seconds in SQL Management Studio. But it takes more than 5 min from the ASP.NET page.
This query is running on more than 500000 records. I cannot change the index of the table as this is a baan table. How can I minimize the running time from the ASP.NET application?
It's hard to read, but this:
where (a.t_mitm in (select t_sitm from ttibom010 where substring (a.t_mitm , 10, 10 ) = '2046000021' )
Dan Bracuk
Contributor
3970 Points
1096 Posts
Re: sql query
Apr 26, 2012 11:52 AM|LINK
It's hard to read, but this:
where (a.t_mitm in (select t_sitm from ttibom010 where substring (a.t_mitm , 10, 10 ) = '2046000021' )
or substring (a.t_mitm , 10, 10 ) = '2046000021'
looks redundant.