1,696 reputation
621
bio website
location Ukraine
age
visits member for 2 years, 7 months
seen 4 hours ago

Sep
24
comment Alternatives for a LEFT OUTER JOIN query
It seems there is (or was) a bug with outer joins, specifically with right outer joins, in H2 according to information on this page. Note that apart from the fact that the issue was not with left outer joins, it also says there the bug was fixed in version 1.3, and, based on this, the latest version appears to be 1.4. Now, you said earlier that H2 was your choice. Did you happen to choose to use an old version of it?
Sep
19
comment Relational Model vs. Database Products
@ThomasKejser: Well, this answer basically boils down to "When you come from theory (relational model) to practice (SQL, RDBMS), don't expect magic". That can be said about virtually any implementation of anything. In any event, is that a good answer to "Other than terminology (relation vs. table, attribute vs. column, tuple vs. row), what are some of the major differences?"?
Sep
18
comment Relational Model vs. Database Products
I think I can see your point now but I also disagree with what you call a difference (or even "the greatest difference"). I think the OP is looking for differences they will be able to observe (like something that one side has and the other doesn't: SQL has NULLs, RM has relational division…), and the fact that RDBMSes are iterative internally is not really observable by the user. On the other hand, it may explain existing differences, so probably you've answered some part of the question.
Sep
18
comment Relational Model vs. Database Products
What is the point of saying that no-one can operate "real sets" (whatever you may mean by those)? I don't think that's what the OP is after. As far as I can see, the question is merely about differences from the perspective of a user of an RDBMS (rather than a human being in general). As a user of an RDBMS, you work with data-sets using set operations provided by the system.
Sep
16
comment sql server date issue
There may be no need to post the entire query. What could be more useful is the type of the dob column, where you are executing the query and consuming the results, and possibly the locale settings of the system where you are executing the query as well.
Sep
16
comment sql server date issue
If dob is a date or datetime, SET LANGUAGE will have no impact on how the column is displayed unless you do CAST(dob AS varchar(…)). If it's a varchar already, SET LANGUAGE will have no impact either. Therefore, SET LANGUAGE alone won't help here.
Aug
19
comment What is better? Delete and insert or update?
Any triggers for update on the table?
Jul
25
comment How do I place leading zeros for numbers less than 10 without affecting those 10+?
Agree with @ypercube. You could change the first comparison to MyColumn < 10 but that might break as we don't know if MyColumn is guaranteed to ever contain only numbers.
Jul
25
comment SQL Server - constraint to prevent overlapping dates
In response to the earlier comment of yours where you are giving an example of INSERT that doesn't work, that INSERT doesn't populate a PreviousFinished value, which it must according to the method in the linked answer.
Jul
25
comment SQL Server - constraint to prevent overlapping dates
Or perhaps you are struggling to understand how the method in the answer to the linked question works?
Jul
25
comment SQL Server - constraint to prevent overlapping dates
Regarding your update, I don't really understand the actual problem you are facing. Is this about your table already having ranges that overlap and you wanting to detect and resolve them?
Jul
23
comment SQL Server - constraint to prevent overlapping dates
That's great news, people will come here and immediately see that this question already has an answer. :)
Jul
23
comment What is the correct way to ensure unique entries in a temporal database design?
How would you go about splitting an existing (closed) range into two with this restriction implemented? Doesn't seem possible to me, but I might be missing something. (However, it certainly seems possible with the other variation, the one that allows gaps.)
Jul
23
comment How do I include nulls during comparisons in SQL Server?
CASE value WHEN 26 THEN 1 ELSE 0 END = 0. Beautiful, ever so intuitive and by all means sanest of ways.</sarcasm>
Jul
14
comment Getting unique names when the IDs are different (DISTINCT ?)
+1, although deriving a table appears to be perfectly unnecessary.
Jun
18
comment SQL2542N - No match for a database image file was found based on the source database alias
Does it matter that you are running the command from the /data/home/db2inst1 directory while the file you say is located in /home/db2inst1?
Jun
18
comment T-SQL Calculate average value for Duration Field
Strangely, thanks to you I've just discovered that DATEDIFF(SECOND, '00:00:00', Duration) is actually slower than your original suggestion, but replacing the '00:00:00' (a string) with a 0 (an integer) did make it faster (than your method). Don't know why we've got different conclusions. (If this matters, I didn't use a table in my tests, because I only wanted to test the expressions, so I assigned same expression to a variable in a loop and measured the time.)
Jun
18
comment T-SQL Calculate average value for Duration Field
You could just get the difference in seconds between '00:00:00' and Duration instead of all the string manipulations.
Jun
6
comment Why can't I use a CASE statement to see if a column exists and not SELECT from it?
@MarkSinkinson: Names are checked after the syntax, but yes, SQL Server does that prior to actually running the batch.
Jun
5
comment Count where two or more columns in a row are over a certain value [basketball, double double, triple double]
TIL: PostgreSQL, like MySQL, permits referencing columns in GROUP BY by aliases or ordinal numbers.