JOOQ vs Hibernate [closed]

While jOOQ and Hibernate compete for the same target audience, they do not solve the same problem at all. You’ve already linked this article in your question. The essence of it is simple: Are you going to solve object graph persistence problems? Use an ORM (e.g. Hibernate) Are you going to embed SQL into Java? … Read more

Is it possible to add index to a temp table? And what’s the difference between create #t and declare @t

#tablename is a physical table, stored in tempdb that the server will drop automatically when the connection that created it is closed, @tablename is a table stored in memory & lives for the lifetime of the batch/procedure that created it, just like a local variable. You can only add a (non PK) index to a … Read more

Filtering by window function result in Postgresql

I don’t know if this qualifies as “more elegant” but it is written in a different manner than Cybernate’s solution (although it is essentially the same) WITH window_table AS ( SELECT s.*, sum(volume) OVER previous_rows as total FROM stuff s WINDOW previous_rows as (ORDER BY priority desc ROWS between UNBOUNDED PRECEDING and CURRENT ROW) ) … Read more

REPLACE versus INSERT in SQL

According to the documentation, the difference is: REPLACE works exactly like INSERT, except that if an old row in the table has the same value as a new row for a PRIMARY KEY or a UNIQUE index, the old row is deleted before the new row is inserted. So what it does: Try to match … Read more

What is the purpose of putting an ‘N’ in front of function parameters in TSQL?

It indicates a “nationalized” a.k.a. unicode string constant. http://support.microsoft.com/kb/239530 When dealing with Unicode string constants in SQL Server you must precede all Unicode strings with a capital letter N, as documented in the SQL Server Books Online topic “Using Unicode Data”. http://msdn.microsoft.com/en-us/library/aa276823%28SQL.80%29.aspx nchar and nvarchar Character data types that are either fixed-length (nchar) or variable-length … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)