aprismatic / prismadb

Prisma/DB public releases and documentation.
34 stars 1 forks source link

Unable to give Alias to Computed Column in MSSQL #24

Closed saklanipankaj closed 5 years ago

saklanipankaj commented 5 years ago
SELECT (t2.a + t3.b ) AS abc, (t2.a * t3.b) AS bcd
FROM t2
JOIN t3 ON t2.a = t3.a; 

HResult 0x4E21, Level 16, State 1 One or more errors occurred. (Value set #1 contains 1 values, while column list contains 2 columns.) (Value set #5 contains 1 values, while column list contains 2 columns.)

Unable to assign Alias to computed column, which is supported in both MySQL and PostgreSQL.

cheziyi commented 5 years ago

What is the schema of the tables?

saklanipankaj commented 5 years ago

I realized the mistake i was making for this query, t3.b was a VARCHAR column that cannot be MULTIPLIED or ADDED, this was a oversight on my part. This issue is resolved.