Re: [SQL] Between and miliseconds (timestamps)

2006-11-10 Thread Joe
Hi Ezequias, On Fri, 2006-11-10 at 16:34 -0200, Ezequias Rodrigues da Rocha wrote: > Ok thank you very much, but the suggestion (SQL:when field = > '2006-09-06'::date) does not retrieve any row. It does not retrive any > error too, but the suggestion does not applied to my requisition. I think y

Re: [SQL] Between and miliseconds (timestamps)

2006-11-10 Thread Ezequias Rodrigues da Rocha
Ok thank you very much, but the suggestion (SQL:when field = '2006-09-06'::date) does not retrieve any row. It does not retrive any error too, but the suggestion does not applied to my requisition. The second suggestion is quite correct but I would like to use the between _expression_.Best regards

Re: [SQL] PostgesSQL equivalent of the Oracle 'contains' operator

2006-11-10 Thread Richard Broersma Jr
> I'm beginning a port of an Oracle application to PostgrSQL. One > immediate issue is the use of the Oracle 'contains' operator to do > whole word searches on table rows that contain blank separated lists of > names. I was told that the original application was written using the > 'like'

[SQL] PostgesSQL equivalent of the Oracle 'contains' operator

2006-11-10 Thread Wm.A.Stafford
I'm beginning a port of an Oracle application to PostgrSQL. One immediate issue is the use of the Oracle 'contains' operator to do whole word searches on table rows that contain blank separated lists of names. I was told that the original application was written using the 'like' operator

Re: [SQL] Wildcard LIKE and Sub-select

2006-11-10 Thread Travis Whitton
I took off the USING clause like so, and it worked like a charm!DELETE FROM keywordsWHERE keyword ILIKE ANY (SELECT '%' || badword || '%'                                                   FROM badwords) Thanks so much,TravisOn 11/10/06, Erik Jones < [EMAIL PROTECTED]> wrote: Travis Whitton wrote:>

Re: [SQL] Wildcard LIKE and Sub-select

2006-11-10 Thread Erik Jones
Travis Whitton wrote: Hi everybody, I have two tables of the following structure: Table "keywords" column | type - id | integer keyword | varchar(255) and Table "badwords" column | type -- badword | varchar(255) I need to delete all th

Re: [SQL] Between and miliseconds (timestamps)

2006-11-10 Thread A. Kretschmer
am Fri, dem 10.11.2006, um 12:50:38 -0200 mailte Ezequias Rodrigues da Rocha folgendes: > > select * from base.table > > where when > > between > > '2006-09-06 00:00: 00.00' > > and > > '2006-09-06 23:59:59.99' > > order by 2 > > > > Is there a simplest

[SQL] Wildcard LIKE and Sub-select

2006-11-10 Thread Travis Whitton
Hi everybody,I have two tables of the following structure:Table "keywords"column   | type-id   | integerkeyword | varchar(255)andTable "badwords" column   | type--badword  | varchar(255)I need to delete all the rows from the keywords table where badwo

Re: [SQL] Constraint on multicolumn index

2006-11-10 Thread Tom Lane
"Stuart Brooks" <[EMAIL PROTECTED]> writes: > But if I want the next item following t=(a=10,b=100,c=1000): > select * from T > where (a=10 AND b=100 AND c>1000) OR (a=10 AND b>100) OR (a>10) > order by a,b,c; The correct way to handle this is to use a SQL-spec row comparison: where (a

Re: [SQL] Between and miliseconds (timestamps)

2006-11-10 Thread A. Kretschmer
am Fri, dem 10.11.2006, um 12:28:53 -0200 mailte Ezequias Rodrigues da Rocha folgendes: > Hi list, > > I noticed that when we use the keyword between in SQL statements we must > considerer all the miliseconds with 6 digits. > > I would like to know if we want to make a day selection we must use

[SQL] Between and miliseconds (timestamps)

2006-11-10 Thread Ezequias Rodrigues da Rocha
Hi list,I noticed that when we use the keyword between in SQL statements we must considerer all the miliseconds with 6 digits.I would like to know if we want to make a day selection we must use allways the max of possibilities like: select * from base.tablewhere whenbetween '2006-09-06 00:00:00.000

[SQL] Constraint on multicolumn index

2006-11-10 Thread Stuart Brooks
Hi, I am not sure this can be done but I'm trying to constrain a sorted set efficiently using a multicolumn index in postgres. The (simplified) scenario is this: CREATE TABLE T ( a INT, b INT, c INT ); CREATE INDEX t_idx ON T(a,b,c); Now I can sort using t_idx: select * from T order by