Closed umer-mehmood closed 5 years ago
Did you mean something like this?
SELECT 'myvalue' AS "my_column" FROM "my_table"
You can use the InlineSQL-helper __
like:
result = sql.build({
$select: {
my_column: { __: "'myvalue'" }
$from: 'my_table'
}
});
Please have a look at https://github.com/planetarydev/json-sql-builder2/tree/master/sql/helpers/misc/__
Did you mean something like this?
SELECT 'myvalue' AS "my_column" FROM "my_table"
You can use the InlineSQL-helper
__
like:result = sql.build({ $select: { my_column: { __: "'myvalue'" } $from: 'my_table' } });
Please have a look at https://github.com/planetarydev/json-sql-builder2/tree/master/sql/helpers/misc/__
This fulfills my requirement. Thank you!!!
We need to add a virtual column in select statement while composing the sql query.
Use Case: We are trying to build a query using postgresql dialect. The query then will be executed on AWS Athena Service. And in case of virtual columns athena requires string values in single qoutes i.e. 'value' as "Column_Name". So the issue is json-sql-builder2 does not add single qoutes for the value of virtual column. Let me know if there is any way. Thanks