Is there a way to write SQL to get all clients second purchases in a table? (Sorting rows by date)
Table Transaction
clientid int
buy_date date
amount int
I prefer to use the Analytic functions, perhaps using count() over()?
Search found 3 matches
- Thu Feb 06, 2014 6:56 pm
- Forum: New to Vertica SQL
- Topic: How to find the second rows in a table?
- Replies: 1
- Views: 5492
- Wed Feb 05, 2014 11:38 pm
- Forum: New to Vertica SQL
- Topic: How to format a date column into only the month.
- Replies: 5
- Views: 16747
Re: How to format a date column into only the month.
The problem with that method is I end up with just a digit ie 1, but it would better to have the month spelled out ie "January", but still sort in date order, not text order.
Perhaps this feature does not yet exist?
Perhaps this feature does not yet exist?
- Wed Feb 05, 2014 11:12 pm
- Forum: New to Vertica SQL
- Topic: How to format a date column into only the month.
- Replies: 5
- Views: 16747
How to format a date column into only the month.
I am trying to format a date column into only the month. select TO_DATE(TO_CHAR(purchase_date), 'Month') from transactions order by 1; I would need the final value in some sort of date datatype so that I can order the results by date/time, not order by text. So that February sorts after January etc....