Thanks for your reply.
In what ways does "Instant SQL Formatter" fall short?
Search found 71 matches
- Thu Jul 17, 2014 1:47 pm
- Forum: New to Vertica SQL
- Topic: SQL formatter or prettyfier?
- Replies: 4
- Views: 53696
- Tue Jul 15, 2014 1:48 pm
- Forum: New to Vertica SQL
- Topic: SQL formatter or prettyfier?
- Replies: 4
- Views: 53696
SQL formatter or prettyfier?
Anyone know of a program which will take SQL code and format it nicely, which works with SQL written for Vertica?
I imagine there are some generic formatters but I'm not sure whether they'd leave the code intact.
I imagine there are some generic formatters but I'm not sure whether they'd leave the code intact.
- Sat Apr 26, 2014 12:59 am
- Forum: Vertica SQL
- Topic: Cast INTEGER to INTERVAL (seconds)
- Replies: 2
- Views: 12223
Re: Cast INTEGER to INTERVAL (seconds)
Thanks, sKwa! You are teh awesome! Just for my own notes: vertica=> SELECT CAST(172 AS INTERVAL SECOND) - CAST(172::VARCHAR || ' s' AS INTERVAL) AS diff; diff ------ 0 (1 row) Kind of silly of me...I think I read the documention too zealously; they're very restrictive on what casts are allowed, even...
- Fri Apr 25, 2014 8:35 pm
- Forum: Vertica SQL
- Topic: Cast INTEGER to INTERVAL (seconds)
- Replies: 2
- Views: 12223
Cast INTEGER to INTERVAL (seconds)
Right now I do this as
Is there a less klunky way of doing it?
Code: Select all
CAST(my_integer::VARCHAR || ' s' AS INTERVAL)
- Tue Apr 15, 2014 2:44 pm
- Forum: Vertica SQL
- Topic: Randomly pick rows from table
- Replies: 2
- Views: 7934
Re: Randomly pick rows from table
I have no, but book Sql Antipatterns does. OK...seems like what he didn't like about it was that it doesn't scale well. I'm only doing some spot-checking, so scaling isn't really a concern for me. May be this thread will interest you too: Selecting a Random Set of Rows from a Table I'll check that ...
- Mon Apr 14, 2014 6:56 pm
- Forum: Vertica SQL
- Topic: Randomly pick rows from table
- Replies: 2
- Views: 7934
Randomly pick rows from table
How can one randomly pick rows from a table? A stackoverflow thread ( http://stackoverflow.com/questions/580639/how-to-randomly-select-rows-in-sql ) suggests SELECT column FROM table ORDER BY RANDOM() LIMIT 1 in the case of one row, for PostgreSQL. The same code seems to work in Vertica, though I do...
- Mon Apr 14, 2014 6:54 pm
- Forum: Vertica SQL
- Topic: display data type of an expression?
- Replies: 6
- Views: 10850
Re: display data type of an expression?
Yeah, that seems like a handy trick. I'll try that soon.sKwa wrote:And how about function overloading?