B
B
BaJar2019-08-16 15:56:47
SQL Server
BaJar, 2019-08-16 15:56:47

How to filter extra lines?

There are documents that have Node with information. With this kind of request, it really shows the name and Node. (since there cannot be more than one Node with this name in the document)

SELECT DocumentTemplateName, DocumentTemplateNodeCaption
from DocumentTemplate join 
DocumentTemplateVersion on DocumentTemplateRef = DocumentTemplateID
join DocumentTemplateNode on DocumentTemplateVersionID = DocumentTemplateVersionRef 
where DocumentTemplateNodeName ='CodeName'

But it is required to find documents in which there is no such Node.
SELECT DocumentTemplateName, DocumentTemplateNodeCaption
from DocumentTemplate join 
DocumentTemplateVersion on DocumentTemplateRef = DocumentTemplateID
join DocumentTemplateNode on DocumentTemplateVersionID = DocumentTemplateVersionRef 
where DocumentTemplateNodeName !='CodeName'

As a result, we have a lot of records, where one document shows 500 Node. - 500 lines in which DocumentTemplateName is repeated Tell me how to edit?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question