Overlap Function

Moderator: NorbertKrupa

Post Reply
User avatar
nnani
Master
Master
Posts: 302
Joined: Fri Apr 13, 2012 6:28 am
Contact:

Overlap Function

Post by nnani » Tue Aug 06, 2013 4:00 pm

Hello All,

I was trying to test the overlap function as mentioned in Vertica

Code: Select all

SELECT (DATE '2007-02-16', DATE '2007-12-21') OVERLAPS (DATE '2008-10-30', DATE '2008-10-30');
-bash: syntax error near unexpected token `DATE'
Can anyone let me know, how do we execute this.

This is same example as mentioned in Vertica Documentation.

Thanks
nnani........
Long way to go

You can check out my blogs at vertica-howto

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: Overlap Function

Post by JimKnicely » Tue Aug 06, 2013 7:19 pm

Looks like you are running the SELECT command in your shell :( You need to run it in vsql...

Won't work:

Code: Select all

[dbadmin@Vertica1 ~]$ SELECT (DATE '2007-02-16', DATE '2007-12-21') OVERLAPS (DATE '2008-10-30', DATE '2008-10-30');
-bash: syntax error near unexpected token `DATE'
Will work:

Code: Select all

[dbadmin@Vertica1 ~]$ vsql -c "SELECT (DATE '2007-02-16', DATE '2007-12-21') OVERLAPS (DATE '2008-10-30', DATE '2008-10-30');"
 overlaps 
----------
 f
(1 row)
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

User avatar
nnani
Master
Master
Posts: 302
Joined: Fri Apr 13, 2012 6:28 am
Contact:

Re: Overlap Function

Post by nnani » Wed Aug 07, 2013 7:00 am

Man............. :lol:

Thanks Jim.
nnani........
Long way to go

You can check out my blogs at vertica-howto

Post Reply

Return to “Vertica SQL”