Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

sql server bool select

SELECT  
M.*,
hasAttachments = EXISTS(SELECT AttachmentId 
                          FROM Attachment 
                         WHERE messageId = M.messageId),
FROM Message M
Source by dba.stackexchange.com #
 
PREVIOUS NEXT
Tagged: #sql #server #bool #select
ADD COMMENT
Topic
Name
6+4 =