Could anyone explain to me why Hibernate does not set the @DynamicInsert annotation by default and allow entities to generate an INSERT based on the currently set properties? What’s the reason for not using @DynamicInsert and, therefore, including all entity properties by default? Answer What @jb-nizet …
Tag: sql
MySQL: Convert relative seconds count to datetime?
I have a MySQL database show uptime for devices. The uptime is how long the device has been up in seconds. I have a query showing all devices with uptime less than 86400 (24 hours) which I want to …
Incorrect syntax in query
Hello i have this query : It says me that : Incorrect syntax near the keyword “AND” Answer Try this
SQL Geometry find all points in a radius
I am fluent in SQL but new to using the SQL Geometry features. I have what is probably a very basic problem to solve, but I haven’t found any good resources online that explain how to use geometry objects. (Technet is a lousy way to learn new things…) I have a collection of 2d points on a Cartesia…
ConfigurationManager in WPF
I have a config file in a wpf project to store the connectionstring. But when I try to get AppSettings and ConnectionStrings, I get null. the WEB.config file is like this: I tried in several ways: None of them worked. But this one worked: (That means I cannot use a config file, which is against my will) I nee…
Stuck on SqlDataReader.GetValues Method
I am making a call to a SQL stored procedure which is returning a small table of users and their bosses. What I would like to do is compare this information against a variable in a different part of …
Missing AddWithValue from DbCommand.Parameters
I am building an sqlwrapper to handle both MSsql and Sqlite, I have no issues using the generic dbconnection, dataset and dataadapter so far, but with dbcommand parameters.add is the only option. I’d like to use parameter.addwithvalue like sqlcommand and sqlitecommand have, but I am unsure how to implem…
Extrapolate running total from .LAST value of a BY GROUP
I trying to figure out how to create a running total, if all we have is the total sum in the .LAST variable. I created a sample dataset that should make it a little clearer what I am after: ; so, as you can see we only have data for the last time the store was in business, which includes
How to automatically subtract or add data from columns in mysql
I am building a system for doctors and patients where the patients submit the type of the medical examination and the quantity of medicine they use. I want to be able to subtract the value of the …
Product() aggregate function
While explaining some concepts over CTE, was asked with a cute question.. can we find the multiplication of rows , while we always concentrate on the SUM() from a fresher. That gave me a thought! Is it ever possible with just an SQL. I was also considering the maximum number precision we can even support, sin…