database-programming

java.util.Date vs java.sql.Date

java.util.Date vs java.sql.Date: when to use which and why? ...

Have mysql re-allocate ids in a continuous range

I have an existing database in mysql. One of my tables has discontinuous ids. I would like to modify the ids of the table so that they go from 1 to num-of-rows. This particular tables does not happen to have incoming references, so the ids can be changed without modifying other tables. The reason I want to do that is that I want to pro...

SQL - Most performant manner to conditionally exlude a join? (if it's even possible)

If I have the following table structure... Table 1: BlogPost PostId | Name | Text Table 2: Tags TagId | Tag Table 3: BlogPostTag PostId | TagId And the following stored procedure... CREATE PROCEDURE SearchBlogPosts @tagstring nvarchar(max), AS BEGIN DECLARE @searchTags TABLE (Tag varchar(50)); IF @tagst...