خرید بک لینک

Vote count: 0

All , Need help in optimizing a query :

There are two tables with below fields:

Table 1 AdminId Policy Locationid CreateTimestamp

Table 2 AdminId Policy CreateTimestamp Detail1 Detail2 . Detail50

Table 2 is a big table will lots of data. For every rec in Table1 there can be thousands of rows in Table2. Requirement is to get the count last one year data from table 2 which have location = NY . I wrote below query but its not optimized and m not able to run it. Please suggest how to optimize this query. Thanks in advance!

Select count(*) from Table2 T2 , Table1 T1 where T1.adminId = T2.adminId and 
T1.policy = T2.policy and T1.location like ('℅NY℅') and 
T2.createTimestamp > ( current Timestamp - 1 year)

asked 5 mins ago

برچسب: نویسنده: استخدام کار تاريخ: پنجشنبه 19 فروردين 1395 ساعت: 0:36

صفحه بندی