title: POSTGRESQL- Query has no destination for result data
body: <p>I'm new to postgres and to programming and I already searched for solution for this but I couldn't quite get it. I'm trying to make a function that will return information about all the customers on that particular country whenever I call the country. This is the error that pops up. I'm really sorry for asking this but I've been stuck here since yesterday.</p>
  
  <blockquote>
    <p>ERROR:  query has no destination for result data<br>
    HINT:  If you want to discard the results of a SELECT, use PERFORM instead.<br>
    CONTEXT:  PL/pgSQL function country(text) line 5 at SQL statement</p>
  </blockquote>
  
  <p>Here is the function:</p>
  
  <pre><code>create or replace function country(text) returns text as $$
  begin
  
  
    select customer_id, customer.first_name, customer.last_name 
  
    from customer 
  
    inner join address on customer.address_id = address.address_id 
    inner join city on address.city_id = city.city_id 
    inner join country on city.country_id = country.country_id 
  
    where country = '$1';
    end;
    $$
  
    language plpgsql;
  </code></pre>