You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

11 lines
336 B

  1. CREATE TYPE addr as (address VARCHAR(255), city_id int);
  2. CREATE OR REPLACE FUNCTION get_address_and_city_for_ex1()
  3. RETURNS TABLE (addr text) AS $$
  4. DECLARE
  5. BEGIN
  6. return QUERY SELECT CONCAT(address, ', ', CAST(city_id as VARCHAR)) from address where address like '%11%' and city_id >= 400 and city_id <= 600;
  7. END;
  8. $$ LANGUAGE plpgsql;