Is there a way to force NHibernate to run a query without executing it as a parameterized query. Basically I’m running into an issue where I am hitting SQL Server’s 2100 parameter limit. I’m hitting a limit because of an “IN” restriction on my query. For reasons I won’t get…
Tag: sql
SQL JOIN with 2 aggregates returning incorrect results
I am trying to join 3 different tables to get how many Home Runs a player has in his career along with how many Awards they have recieved. However, I’m getting incorrect results: Peoples PlayerId …
How to write a query to compare current date to created_at timestamps in database?
I would like to write a query to compare created_at timestamp with my current date in Ruby on Rails using ActiveRecord and I don’t quite know how do it yet Date is stored like this -> created_at: …
Oracle SQL – return the date record when there is no count result
I have the tables below and I need my query to bring me the amount of operations grouped by date. For the dates on which there will be no operations, I need to return the date anyway with the zero …
Why does the table randomly reorganize the rows?
I have the following table DBName Server Status UpdateTime DB1 server1 NULL 5/4/2019 DB1 server1 NULL NULL DB2 server2 NULL 6/4/2019 DB2 server2 NULL 6/4/2019 DB3 server2 NULL NULL …
How to show 5 maximum value after joining two tables?
I have 2 tables: users(uid, rollno, name) results(rid, uid, marks) So I want to show the highest 5 marks holder with their roll no and marks like- MCA-03/17 16 MCA-01/17 15 MCA-04/17 8 MCA-…
Join repeatedly until a string is present?
While querying a subset of our employees, I’m trying to add a field for the SVP they “roll up” to. Employees may have anywhere from 1 to 5 or 6 degrees of separation from their SVP. The trouble is, …
RANK() function with over is creating ranks dynamically for every run
I am creating ranks for partitions of my table. Partitions are performed by name column with ordered by its transaction value. While I am generating these partitions and checking count for each of the …
How can I “Update Select” some values in a column with a subquery?
I am using Apache Derby DB (SQL) version 10.14 and this is the Derby Reference Manual: https://db.apache.org/derby/docs/10.14/ref/refderby.pdf I am trying to create a star schema and am currently …
MySQL output gives values from different rows
I am working on sql and there are 4 different columns which are pname, Fname,Flastname and amount. It gives the correct outputs for pname and amount but fname and flastname are from different rows …