Thread: select in a LIKE?

select in a LIKE?

From
"Arsalan Zaidi"
Date:
Hi

Can I construct a LIKE out of a select query? Something like

select * from users where name like '%(select name from blah)'

Currently, this won't work.

--Arsalan
-------------------------------------------------
WAR IS PEACE
FREEDOM IS SLAVERY
IGNORANCE IS STRENGTH
--1984




Re: select in a LIKE?

From
Dave Page
Date:
Does:

SELECT * FROM users WHERE name LIKE '%' || (SELECT name FROM blah LIMIT 1)

Work?

Regards, Dave.

> -----Original Message-----
> From: Arsalan Zaidi [mailto:azaidi@directi.com] 
> Sent: 03 October 2001 08:41
> To: PostgreSQL
> Subject: [INTERFACES] select in a LIKE?
> 
> 
> Hi
> 
> Can I construct a LIKE out of a select query? Something like
> 
> select * from users where name like '%(select name from blah)'
> 
> Currently, this won't work.
> 
> --Arsalan
> -------------------------------------------------
> WAR IS PEACE
> FREEDOM IS SLAVERY
> IGNORANCE IS STRENGTH
> --1984
> 
> 
> 
> ---------------------------(end of 
> broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to 
> majordomo@postgresql.org
>