title: Select HasChildren in a table that has ParentID
body: <p>I have the following table,</p>
  
  <pre><code>CREATE TABLE [dbo].[Catalogs]
  (
      [ID] [INT] IDENTITY(1,1) NOT NULL,
      [Name] NVARCHAR(255) NOT NULL,
      [Description] NVARCHAR(500) NULL,
      [Icon] NVARCHAR(255) NULL,
      [Order] INT NOT NULL,
      [ParentID] INT NULL,
      [CreatorID] INT NOT NULL,
      [LastModifierID] INT NOT NULL,
      [CreationDate] DATETIME NOT NULL,
      [LastModifiedDate] DATETIME NOT NULL,
      PRIMARY KEY (ID)
  )
  </code></pre>
  
  <p>Now I want to select all catalogs with HasChildren column. </p>
  
  <p><strong>Edit:</strong> HasChildren will be generated at run time. If the row's ID does not available in ParentID column in all rows.</p>