Two column join between tables, one column with equal to and other columns with not equal to

تعرفه تبلیغات در سایت
عنوان عکس عنوان عکس عنوان عکس عنوان عکس
عنوان عکس عنوان عکس عنوان عکس عنوان عکس
عنوان عکس عنوان عکس عنوان عکس عنوان عکس
عنوان عکس عنوان عکس عنوان عکس عنوان عکس
عنوان عکس عنوان عکس عنوان عکس عنوان عکس

آرشیو مطالب

جستجوگر

یافته ها در جستجو

    امکانات وب

    برچسب ها

    Two tables each with 6.4 million records in SQL Server 2012. Let's say A and B. I have to join two tables based on two columns. Lets say A.C1 = B.C1 and also A.C2 <> B.C2. Both C1 and C2 are nvarchar columns. Table B does not have cluster index. I have the query as show below:

    Select B.C1...A.C12, A.C2...A.C5 from A inner join B on A.C1 = B.C1 Where A.C2 <> B.C2

    This is taking a more than 16 min to 30 min. It does a full table scan on B as other columns from B. When it takes more than 30 mins, the query timeouts. Can you please let me know what is the best way to write this query.

  • مطالب مرتبط
  • What is difference between dynamic pointer allocation for a single variable and array?
  • Creating new column with two date conditions from old column R
  • Grant permissions to resource in one subscription to application from another subscription? (Azure AD multitenant apps)
  • Pandas and R inconsistency in calculating column size
  • Breaking change in handling empty observables between 4.3 and 4.4?
  • Multiply two column in python to make multipleindex
  • نویسنده : استخدام کار بازدید : 11 تاريخ : دوشنبه 13 شهريور 1396 ساعت: 16:28
    برچسب‌ها :