title: Select count with LIKE operator in Postgresql
body: <p>I have defined these tables:</p>
  
  <pre><code>CREATE TABLE domain (
    id          BIGSERIAL NOT NULL,
    name       varchar(255) NOT NULL,
    PRIMARY KEY (id));
  
  CREATE TABLE url (
    id         BIGSERIAL NOT NULL,
    url       text NOT NULL,
    PRIMARY KEY (id));
  </code></pre>
  
  <p>And I want to count how many urls for each domain. I try to do this like this:</p>
  
  <pre><code>SELECT
      domain.name AS dn,
      SELECT COUNT(*) FROM url WHERE url.url ILIKE '%' || dn || '%'
  </code></pre>
  
  <p>but without luck. Got Syntax error.
  How to make it right?</p>