I tried but it's not working
MSSQL raise an error "Incorrect syntax near the keyword 'UNPIVOT'".
It is because a "comma", right after the alias "p1" and before the operator
UNPIVOT, is found in the SQL statement
Please advise. thank you.
On Thursday, June 21, 2018 at 12:25:28 PM UTC-7, Jeremy Evans wrote:
> On Thursday, June 21, 2018 at 10:41:52 AM UTC-7, lkfken wrote:
>> Hi Jeremy,
>> Sorry about that. I misunderstood on what you need.
>> Here is the SQL statement
>> SELECT NAME,
>> FROM (SELECT NAME,
>> FROM test
>> WHERE NAME = 'TOM') AS p1
>> UNPIVOT ( dates
>> FOR source IN (a_date,
>> c_date) ) AS p2;
>> so what I want is to have "p1" come from Sequel::Dataset (ie: Test.toms,
>> Test.joes, etc) instead of hard code it into this SQL statement.
> This should work, and produce the same SQL (modulo identifier quoting):
> DB.select(:NAME, :dates, :source).
> from(DB[:test].select(:NAME, :a_date, :b_date,
> Sequel.lit("UNPIVOT (dates FOR source IN (a_date, b_date,
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to email@example.com.
Visit this group at https://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/d/optout.