> >
> > Given that tablename is "voipdb"; I wonder if OP really
> wants to write
> > a query that finds the row where argument to function
> matches the most
> > number of leading characters in "prefix".
> >
> > If voipdb table contains: ab, abc, def, defg; then calling
> function
> > wit
On Saturday 05 Sep 2009, Frank Bax wrote:
> Raj Mathur wrote:
> > On Saturday 05 Sep 2009, bilal ghayyad wrote:
> >> I have an sql script function that take one text parameter "funct
> >> (text)", what I need to do is the following:
> >>
> >> If the parameter name is string and its value was for ex
Raj Mathur wrote:
On Saturday 05 Sep 2009, bilal ghayyad wrote:
I have an sql script function that take one text parameter "funct
(text)", what I need to do is the following:
If the parameter name is string and its value was for example "abcd"
then I need to do a query based on ab and then base
On Saturday 05 Sep 2009, bilal ghayyad wrote:
> I have an sql script function that take one text parameter "funct
> (text)", what I need to do is the following:
>
> If the parameter name is string and its value was for example "abcd"
> then I need to do a query based on ab and then based on the abc
Hello;
I have an sql script function that take one text parameter "funct (text)", what
I need to do is the following:
If the parameter name is string and its value was for example "abcd" then I
need to do a query based on ab and then based on the abc, how?
Example:
SELECT * from voipdb where
Hi,
How can I compare two fields if one is a substring of the other?
Something like:
... WHERE StringA like '%' + StringB + '%';
Thanks,
Guy Korland
---(end of broadcast)---
TIP 3: if posting/reading through Usenet, please send an appropri
On Wed, Nov 12, 2003 at 11:38:31 -0300,
Franco Bruno Borghesi <[EMAIL PROTECTED]> wrote:
> ... WHERE field1 LIKE '%' || field2 || '%'
The first way won't work correctly if field2 has %s in it.
> or
> ... WHERE position(field2 in field1)>0
---(end of broadcast)--
... WHERE field1 LIKE '%' || field2 || '%'
or
... WHERE position(field2 in field1)>0
On Wed, 2003-11-12 at 11:07, Guy Korland wrote:
Hi,
How can I compare two fields if one is a substring of the other?
Something like:
... WHERE StringA like '%' + StringB + '%';
Thanks,
Guy Korland
--
Hi,there,
I am not sure what is your question mean. However,
if the type of datefoo is a timestamp then try:
select foo from table where date(datefoo) = '2000-12-14';
select foo from table where datefoo::date = '2000-12-14'::date;
select foo from table where substr(datefoo,1,10) = '2000-12-14';
On Tue, 19 Dec 2000, Jeff MacDonald wrote:
> hi folks..
>
> i want to do this to a datetime field..
>
> select foo from table where substr(datefoo,1,11) = '2000-12-14';
And why not to_char()?
Karel
Hehe, here is my tests with this:
ctntest2=# SELECT create_date FROM users;
create_date
2000-08-29 13:01:53-04
2000-08-27 20:04:41-04
2000-08-27 21:24:28-04
2000-08-30 09:51:16-04
2000-07-25 23:14:08-04
2000-07-25 23:14:08-04
2000-09-01 02:53:02-04
2000-07-2
Jeff MacDonald wrote:
>
> hi folks..
>
> i want to do this to a datetime field..
>
> select foo from table where substr(datefoo,1,11) = '2000-12-14';
>
> it returns no results yet..
>
> select substr(datefoo,1,11) does return some values that say
> 2000-12-14
>
> any clues ?
>
> Jeff MacDon
> i want to do this to a datetime field..
>
> select foo from table where substr(datefoo,1,11) = '2000-12-14';
>
> it returns no results yet..
>
> select substr(datefoo,1,11) does return some values that say
> 2000-12-14
Ummm... because '2000-12-14' is a ten-character, not eleven
character lo
Jeff,
> i want to do this to a datetime field..
>
> select foo from table where substr(datefoo,1,11) = '2000-12-14';
>
> it returns no results yet..
>
> select substr(datefoo,1,11) does return some values that say
> 2000-12-14
Well, for one it's not a string, it's a datetime field.
WHy are y
On Tue, 19 Dec 2000, Jeff MacDonald wrote:
> hi folks..
>
> i want to do this to a datetime field..
>
> select foo from table where substr(datefoo,1,11) = '2000-12-14';
>
> it returns no results yet..
>
> select substr(datefoo,1,11) does return some values that say
> 2000-12-14
>
> any clues
Hi Jeff,
'2000-12-14' is only 10 chars long.
You're asking for an 11-char long substring to match a 10-char ... not
going to happen!
You can see this better if you do something like this ...
select '@' || substr(datefoo,1,11) || '@' from table;
... and you'll get results like:
@2000-12-14 @
S
hi folks..
i want to do this to a datetime field..
select foo from table where substr(datefoo,1,11) = '2000-12-14';
it returns no results yet..
select substr(datefoo,1,11) does return some values that say
2000-12-14
any clues ?
Jeff MacDonald,
---
17 matches
Mail list logo