Tag Archives: SQL

MsSQL having max(id) = id problem –> row_number partition

One problem I haven’t been able to solve in a satisfying way is to create a query that returns a full row based on an aggregate function. Suppose we have the following database schema: If you need to write a query that returns the most expensive book for each customer you probably would first write […]

Comments Off on MsSQL having max(id) = id problem –> row_number partition  

Pass list or array as a parameter to a Sql query

Like most developers my first Sql query was something like: SELECT * FROM TABLE WHERE FIELD = ‘value’ Which is a good starting point to learn Sql. After some time, I combined programming and Sql together, and wrote something which most developers will recognize: rs.open "Select firstn* from Employees where lastname like ‘" & textbox1.Text […]

Comments Off on Pass list or array as a parameter to a Sql query