sqlkata / querybuilder

SQL query builder, written in c#, helps you build complex queries easily, supports SqlServer, MySql, PostgreSql, Oracle, Sqlite and Firebird
https://sqlkata.com
MIT License
3.09k stars 499 forks source link

Value Expressions #670

Closed davisylvestre closed 1 year ago

davisylvestre commented 1 year ago

I would like to know if it is possible to build the queries below. I left an example in SQL Server and another in SQLite. I'm not familiar with the other database drivers. The records would come from a list List<T>

PS: sorry for any English mistakes, it's not my native language

SQLite

WITH emp_master (emp_id, first_name, last_name, salary) AS(
  VALUES (1,"Honey","Patel",10100),
         (2,"Shweta","Jariwala", 19300),
         (3,"Vinay","Jariwala", 35100)
)
SELECT *
  FROM emp_master;

SQL Server

SELECT *
  FROM (VALUES (1,"Honey","Patel",10100),
               (2,"Shweta","Jariwala", 19300),
               (3,"Vinay","Jariwala", 35100)) emp_master (emp_id, first_name, last_name, salary);
ahmad-moussawi commented 1 year ago

I think you are looking for https://sqlkata.com/release/v2.3.8#ad-hoc-inline-table

github-actions[bot] commented 1 year ago

It looks like there hasn't been a reply in 30 days, so I'm closing this issue.