Re: Differences in WHERE clause of SELECT
От | Prabakaran, Vaishnavi |
---|---|
Тема | Re: Differences in WHERE clause of SELECT |
Дата | |
Msg-id | A09FCFD6831B314F9793FEE2D9615B8123C6@ack0102.au.fjanz.com обсуждение исходный текст |
Ответ на | Re: Differences in WHERE clause of SELECT (Jaime Casanova <jaime@2ndquadrant.com>) |
Список | pgsql-hackers |
On Wed, Jul 10, 2013 at 8:42 PM, Prabakaran, Vaishnavi <vaishnavip@fast.au.fujitsu.com> wrote: > Hi Berkus, > > Thanks for your time and response. > > I do understand that there is no LIKE operator support for integers and it would be great if you could help me understandthe reason why is it not supported. > > My intention is to know whether this is not supported because of any technical limitation or is it against any Postgresql/SQLstandards. > > the latter I see. Understood. Looking at the SQL standard it does say that the operands needs to be character or octet. But I was hopingthat this can be overridden by implicit conversion rules which are implementation specific. > My use cases are like below ones : > Integer LIKE pattern [ESCAPE escape-character] 1. List all the > customers who are having negative balance: > SELECT * from Customer where balance LIKE '-%' > this is not cleaner implemented this way? SELECT * FROM customer WHERE balance < 0; > 2. List all the customers whose id starts with 1: > SELECT * from Customer where cust_id LIKE '1%' > > there is any real use for that query? i understand if you ask for all customers whose names begins with 'A' but that thecode begins with '1'? A legacy application we are migrating does have a weird requirement like this because it was running on 'another' RDBMS whichdoes have support for implicit casting in LIKE predicate. Rgds, Vaishnavi -- Jaime Casanova www.2ndQuadrant.com Professional PostgreSQL: Soporte 24x7 y capacitación Phone: +593 4 5107566 Cell: +593 987171157
В списке pgsql-hackers по дате отправления: