The use of ellipsis here is quite unhelpful..

  -- Regards, Morten
mortenn
0

Comments

3 comments

  • way0utwest
    Does this happen often? Is Counter in multiple tables in this query? Do you know what might be on the right side?
    way0utwest
    0
  • mortenn
    I don't remember seeing it for other queries, but it consistently happens for this one view definiton;

    SELECT<br>&nbsp;&nbsp;&nbsp; important_messages.id, name, alias, operation AS product_operation, important_messages.message, comment_startup, comment_stop,<br>&nbsp;&nbsp;&nbsp; registered, registered_by, selection.article, batch, counter, from_date, to_date<br>FROM (<br>&nbsp;&nbsp;&nbsp; SELECT &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dbo.important_messages.id,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dbo.important_message_limit_batches.article,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; batch<br>&nbsp;&nbsp;&nbsp; FROM dbo.important_messages<br>&nbsp;&nbsp;&nbsp; JOIN dbo.important_message_operations ON (dbo.important_messages.id = dbo.important_message_operations.message)<br>&nbsp;&nbsp;&nbsp; JOIN hqas_product_operations ON (dbo.important_message_operations.operation = dbo.hqas_product_operations.id)<br>&nbsp;&nbsp;&nbsp; JOIN dbo.important_message_limit_batches ON dbo.important_messages.id = dbo.important_message_limit_batches.message<br>&nbsp;&nbsp;&nbsp; UNION<br>&nbsp;&nbsp;&nbsp; SELECT &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dbo.important_messages.id,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dbo.hqas_batch_operations.article,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dbo.hqas_batch_operations.batch<br>&nbsp;&nbsp;&nbsp; FROM dbo.important_messages<br>&nbsp;&nbsp;&nbsp; JOIN dbo.important_message_operations ON (dbo.important_messages.id = dbo.important_message_operations.message)<br>&nbsp;&nbsp;&nbsp; JOIN hqas_product_operations ON (dbo.important_message_operations.operation = dbo.hqas_product_operations.id)<br>&nbsp;&nbsp;&nbsp; JOIN dbo.hqas_batch_operations ON dbo.hqas_product_operations.id = dbo.hqas_batch_operations.source<br>&nbsp;&nbsp;&nbsp; JOIN dbo.hqas_batches ON dbo.hqas_batch_operations.article = dbo.hqas_batches.article AND dbo.hqas_batch_operations.batch = dbo.hqas_batches.batch<br>&nbsp;&nbsp;&nbsp; JOIN dbo.important_message_limit_count ON dbo.important_messages.id = dbo.important_message_limit_count.message<br>&nbsp;&nbsp;&nbsp; WHERE counter > 0<br>&nbsp;&nbsp;&nbsp; UNION<br>&nbsp;&nbsp;&nbsp; SELECT &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dbo.important_messages.id,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; dbo.hqas_batch_operations.article,<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; batch<br>&nbsp;&nbsp;&nbsp; FROM dbo.important_messages<br>&nbsp;&nbsp;&nbsp; JOIN dbo.important_message_operations ON (dbo.important_messages.id = dbo.important_message_operations.message)<br>&nbsp;&nbsp;&nbsp; JOIN hqas_product_operations ON (dbo.important_message_operations.operation = dbo.hqas_product_operations.id)<br>&nbsp;&nbsp;&nbsp; JOIN dbo.hqas_batch_operations ON dbo.hqas_product_operations.id = dbo.hqas_batch_operations.source<br>&nbsp;&nbsp;&nbsp; JOIN dbo.important_message_limit_date ON dbo.important_messages.id = dbo.important_message_limit_date.message<br>&nbsp;&nbsp;&nbsp; WHERE GETDATE() BETWEEN from_date AND to_date<br>) AS selection<br>JOIN important_messages ON selection.id = dbo.important_messages.id<br>JOIN dbo.important_message_operations ON (dbo.important_messages.id = dbo.important_message_operations.message)<br>JOIN hqas_product_operations ON (dbo.important_message_operations.operation = dbo.hqas_product_operations.id)<br>LEFT JOIN important_message_limit_count ON (important_messages.id = important_message_limit_count.message)<br>LEFT JOIN important_message_limit_date ON (important_messages.id = important_message_limit_date.message)


    mortenn
    0
  • mortenn
    and counter is only in the table important_message_limit_count, I do believe. Maybe it gets confused by the left join outside the subquery part where this popup is opened..
    mortenn
    0

Add comment

Please sign in to leave a comment.