Skip to content Skip to sidebar Skip to footer
Showing posts from February, 2023

Postgres On Conflict Do Update On Composite Primary Keys

I have a table where a user answers to a question. The rules are that the user can answer to many q… Read more Postgres On Conflict Do Update On Composite Primary Keys

Converting Date String To Another String

How can I convert from '2014-10-13T10:41:22.863+08:00' into '2014-10-13 10:41'? I h… Read more Converting Date String To Another String

Getting @@IDENTITY From TableAdapter

I am trying to complete a seemingly simple task that has turned into a several hour adventure: Get… Read more Getting @@IDENTITY From TableAdapter

Wordpress Delete Posts Not In Specific Categories Using Wpdb Query

How do I modify the following query to delete all posts with the custom post type 'listings'… Read more Wordpress Delete Posts Not In Specific Categories Using Wpdb Query

How To Do Incremental Loading In SQL Server

I have two tables product_source (with 50 records) and product_target (no records). create table p… Read more How To Do Incremental Loading In SQL Server

T-SQL How To Select Rows Without Duplicate Values From One Column?

I have a table with 2 columns ID, ID_PROJ_CSR The content of that table is: ID ID_PROJ_CSR ----… Read more T-SQL How To Select Rows Without Duplicate Values From One Column?

How To Create Table With Values Summed By Year In Postgres

The postgres database format is: year product sales account 2013 bread 10 00… Read more How To Create Table With Values Summed By Year In Postgres

Is There A "split" Function In T-sql For A SELECT Query

I want to use my function like this SELECT BaseSplit(line,';') FROM table is there any way… Read more Is There A "split" Function In T-sql For A SELECT Query

Make Data In Database Read-only But Allow Schema Changes

This is a clarification of an earlier question I asked. It is sufficiently different from that que… Read more Make Data In Database Read-only But Allow Schema Changes

Is There A Big Technical Difference Between VARBINARY(MAX) And IMAGE Data Types?

I was reading on internet these statements about SQL Server data types: VARBINARY(MAX) - Binary st… Read more Is There A Big Technical Difference Between VARBINARY(MAX) And IMAGE Data Types?

How To Pass Parameter In HQL Query

find below my HQL query Query query = session.createQuery('select u from UserLog u where u.use… Read more How To Pass Parameter In HQL Query

How To Create An "on-the-fly" Mapping Table Within A SELECT Statement In Postgresql

I'm creating a select statement that combines two tables, zone and output, based on a referenc… Read more How To Create An "on-the-fly" Mapping Table Within A SELECT Statement In Postgresql

Entity Framework 4.2 : Getting Proper Database Errors

In my ASP.NET MVC 3 application, I use EF 4.2. In my database, I have a unique constraint for a col… Read more Entity Framework 4.2 : Getting Proper Database Errors

How Can I Reliably Convert YYYYMMDDhhmmss To A Date/time?

I have a data source where the dates come back like this: 20150614140520-0500 How can I display thi… Read more How Can I Reliably Convert YYYYMMDDhhmmss To A Date/time?

SSRS Issues With 32bit And 64bit ODBC Drivers

The ultimate goal is for users to be able to run a report that looks pretty and grabs current infor… Read more SSRS Issues With 32bit And 64bit ODBC Drivers

Count(*) Not Working Properly

I create the trigger A1 so that an article with a certain type, that is 'Bert' cannot be ad… Read more Count(*) Not Working Properly

How To Throw Exception From SQL Server 2005 Function?

When I try to use RaiseError, I get the following compilation issue Msg 443, Level 16, State 14, … Read more How To Throw Exception From SQL Server 2005 Function?

Is There An Efficient Way To Break A Date Range Into Hours Per Day?

In SQL Server I am attempting to break a date range into hours per day and have the following bit o… Read more Is There An Efficient Way To Break A Date Range Into Hours Per Day?

Hibernate Custom Join Clause On Association

I would like to associate 2 entities using hibernate annotations with a custom join clause. The cla… Read more Hibernate Custom Join Clause On Association

Only Allow One Of Two Columns To Be Set

I'm looking for a constraint in an SQL table that will only allow one of two nullable columns t… Read more Only Allow One Of Two Columns To Be Set

Returning Varchar(max) Output Parameter From Stored Procedure Truncating To 4000 Characters

I've got a classic ASP appln with a SQL2012 database. I recently changed a table column from v… Read more Returning Varchar(max) Output Parameter From Stored Procedure Truncating To 4000 Characters

How To Combine Data From Multiple Tables Using SQL?

I have following tables in my MySql database : +----------------------------------------------+ … Read more How To Combine Data From Multiple Tables Using SQL?

Insert Into With Combination Of Inner Join

How can I make an insert statement of this select statement? SELECT et FROM user inner joi… Read more Insert Into With Combination Of Inner Join

SELECT All The Newest Record Distinct Keyword With A Non Null Value In One Column

Following on from this question SELECT the newest record with a non null value in one column I know… Read more SELECT All The Newest Record Distinct Keyword With A Non Null Value In One Column

Implementing Own Android CursorAdapter For Search Suggestions - Unknown Exceptions

I have implemented my own cursor adapter to manually handle suggestions, so that I can get rid of t… Read more Implementing Own Android CursorAdapter For Search Suggestions - Unknown Exceptions

Most Efficient Way To Do A SQL 'INSERT IF NOT EXISTS'

Which of the following would perform better? (1) **INSERT IGNORE** cursor.execute('INSERT IGNOR… Read more Most Efficient Way To Do A SQL 'INSERT IF NOT EXISTS'

Haversine Formula Using SQL Server To Find Closest Venue - Vb.net

I am grabbing a postcode from a form. I can then convert this postcode to lng,lat coordinates as I … Read more Haversine Formula Using SQL Server To Find Closest Venue - Vb.net

How To Execute A SQL String That References A Table Variable?

I have a table variable in SQL Server 2008 DECLARE @specsAndModel TABLE ( specName … Read more How To Execute A SQL String That References A Table Variable?