
The use of ellipsis here is quite unhelpful..
-- Regards, Morten
Comments
3 comments
-
Does this happen often? Is Counter in multiple tables in this query? Do you know what might be on the right side?
-
I don't remember seeing it for other queries, but it consistently happens for this one view definiton;
SELECT<br> important_messages.id, name, alias, operation AS product_operation, important_messages.message, comment_startup, comment_stop,<br> registered, registered_by, selection.article, batch, counter, from_date, to_date<br>FROM (<br> SELECT <br> dbo.important_messages.id,<br> dbo.important_message_limit_batches.article,<br> batch<br> FROM dbo.important_messages<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> JOIN dbo.important_message_limit_batches ON dbo.important_messages.id = dbo.important_message_limit_batches.message<br> UNION<br> SELECT <br> dbo.important_messages.id,<br> dbo.hqas_batch_operations.article,<br> dbo.hqas_batch_operations.batch<br> FROM dbo.important_messages<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> JOIN dbo.hqas_batch_operations ON dbo.hqas_product_operations.id = dbo.hqas_batch_operations.source<br> 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> JOIN dbo.important_message_limit_count ON dbo.important_messages.id = dbo.important_message_limit_count.message<br> WHERE counter > 0<br> UNION<br> SELECT <br> dbo.important_messages.id,<br> dbo.hqas_batch_operations.article,<br> batch<br> FROM dbo.important_messages<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> JOIN dbo.hqas_batch_operations ON dbo.hqas_product_operations.id = dbo.hqas_batch_operations.source<br> JOIN dbo.important_message_limit_date ON dbo.important_messages.id = dbo.important_message_limit_date.message<br> 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)
-
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..
Add comment
Please sign in to leave a comment.