Skip to content Skip to sidebar Skip to footer
Showing posts from November, 2024

Should I Call The Database Connection Setup In Each Method Or Just Once In Constructor

I'm working on a small project in Java and I have got DatabaseController class which contains m… Read more Should I Call The Database Connection Setup In Each Method Or Just Once In Constructor

Update Statement Not Generating Syntax Error When Using And Instead Of Comma

I was browsing on MySQL Documentation about the update. See UPDATE Syntax. I found out that the syn… Read more Update Statement Not Generating Syntax Error When Using And Instead Of Comma

Insert String's Each Values Into A Single Column

Here I want to insert the complete string each values into a column. For which I have written the f… Read more Insert String's Each Values Into A Single Column

Give Permissions To A Stored Procedure

I have a stored procedure that does a merge into a table. Let's call it someSchema.UpsertSomeSt… Read more Give Permissions To A Stored Procedure

What Data Type Does The Sqlcommand Method Executescalar() Return?

In SQL Server, ID is a not null integer, and an identity. When I run the following code, I get an… Read more What Data Type Does The Sqlcommand Method Executescalar() Return?

Sequel Gem Increment

I am trying to use the Ruby Sequel gem for DB operations. I am stuck for incrementing and decrement… Read more Sequel Gem Increment

Convert Sql Query With Subquery To Laravel Query

Is it possible to convert my SQL Query to Laravel 4 Query SQL: SELECT Branch_tbl.ID, Branch_tbl… Read more Convert Sql Query With Subquery To Laravel Query

Delete Records Which Are Considered Duplicates Based On Same Value On A Column And Keep The Newest

I would like to delete records which are considered duplicates based on them having the same value … Read more Delete Records Which Are Considered Duplicates Based On Same Value On A Column And Keep The Newest

Matrix Multiplication In Python And Mysql

I have a currency exchange dictionary, as follows: exchange_rates = {'USD': 1.00000, … Read more Matrix Multiplication In Python And Mysql

Sqlite3 Activerecord :order => "time Desc" Doesn't Sort

rails 2.3.4, sqlite3 I'm trying this Production.find(:all, :conditions => ['time > ?… Read more Sqlite3 Activerecord :order => "time Desc" Doesn't Sort

Array Not Being Returned By Select Query Inside Plpgsql Test Case

SELECT query I am using: SELECT ARRAY[table_name,pg_size_pretty(table_size)] FROM ( SELECT … Read more Array Not Being Returned By Select Query Inside Plpgsql Test Case

Dynamic Table Name With Entity Framework

I have many tables with the same model structure but with other table names with other data (in thi… Read more Dynamic Table Name With Entity Framework

Need Lambda Expression Orderby With Datetime Conversion

I am trying to create a lambda expression (Linq, C# 3.5) that can perform a OrderBy on a value that… Read more Need Lambda Expression Orderby With Datetime Conversion

Group By And Stuff Combined Result In Sql Server

I referred the this LINK but when I try to use the same format I am confused whether I have to use … Read more Group By And Stuff Combined Result In Sql Server

Solution To Avoid Double-hop From Client > Web Service > Sql Server

My project invoves a user connecting from client to web service, and then web service to SQL Server… Read more Solution To Avoid Double-hop From Client > Web Service > Sql Server

Sql Join Only If All Records Have A Match

I have 3 tables: CP_carthead (idOrder) CP_cartrows (idOrder, idCartRow) CP_shipping (idCartRow, i… Read more Sql Join Only If All Records Have A Match

Longest Prefix Match In Sql Server 2000

I have 2 tables. lets just say its records and numbers the records.number contains a number which I… Read more Longest Prefix Match In Sql Server 2000

Start The First Day Of The Week As Sunday In Sql

I want my first day of the week to be as Sunday but my issue with my code is that it starts always … Read more Start The First Day Of The Week As Sunday In Sql

How To Add Blank Rows When Select Query Sql

Example : when I type : select number, city from user The results in the get is 3 rows. How to … Read more How To Add Blank Rows When Select Query Sql

How To Iterate Through An Sql Table Which "parent" And Child" Rows Are In Same Table

In a table there are the columns ID, Title and ParentID. ParentID is used for the ID of the entry i… Read more How To Iterate Through An Sql Table Which "parent" And Child" Rows Are In Same Table

How To Query Sum Previous Row Of The Same Column With With Pgsql

I need to put in column RESULT the sum of same row's column SOMETHING and previous row column S… Read more How To Query Sum Previous Row Of The Same Column With With Pgsql

Python 3 And Mysql Through Sqlalchemy

Currently: SQLAlchemy installed and working (or at least import v0.8.0b2) Mysql (v5.5.16) Distribu… Read more Python 3 And Mysql Through Sqlalchemy

Help With Sql/linq Debugging

I'm having trouble with the following statement, which is returning the error 'Sequence con… Read more Help With Sql/linq Debugging

Select Duplicates From A Single Row?

Here I have a table called CoreTracks: +---------+-----------------+----------+----------+--------… Read more Select Duplicates From A Single Row?

How To Use T-sql Merge In This Case?

I'm new to T-SQL command MERGE so I found a place in my SQL logic where I can use it and want t… Read more How To Use T-sql Merge In This Case?

T-sql Script To Calculate Time Difference Between Multiple Rows

I have a table that looks like this: EventDateTime EventName AppID --------------------… Read more T-sql Script To Calculate Time Difference Between Multiple Rows

How To Add Dynamic Where Clause In Codeigniter Query

I am working in codeigniter and trying to make a dynamic query, right now my query looks like $quer… Read more How To Add Dynamic Where Clause In Codeigniter Query

Update Sql Ms Access 2010

This is wrecking my brains for 4 hours now, I have a Table named BreakSked, and I this button to up… Read more Update Sql Ms Access 2010

Error In Your Sql Syntax; Check The Manual That Corresponds To Your Mysql Server Version

HTML CODE Read more Error In Your Sql Syntax; Check The Manual That Corresponds To Your Mysql Server Version

Rails. Select Records With Max()

I have a table like this, and I want to return the top two person (by name) with the highest salary… Read more Rails. Select Records With Max()

Php Echo Inside Echo

I'm trying to call an HTML/PHP content that it's inside my database using: When the row i… Read more Php Echo Inside Echo

Sqlsrv Very Slow Over Network

I'm using sqlsrv (php_pdo_sqlsrv_55_ts.dll and php_sqlsrv_55_ts.dll) in PHP (5.5.12) to connect… Read more Sqlsrv Very Slow Over Network

Run A Delete Statement Certain Table Names Stored In A Table

I have a table which stores the names of certain tables - tableNames. I'd like to run a DELETE … Read more Run A Delete Statement Certain Table Names Stored In A Table

Does Bigquery Support "execute Immediate" Command To Run Dynamic Query?

I can code like this in Oracle to create tables dynamically using 'execute immediate 'sql q… Read more Does Bigquery Support "execute Immediate" Command To Run Dynamic Query?

Parse Querystring In Sql Server 2005

Is there a simple way to parse QueryString parameters (e.g. foo=bar&temp=baz) in SQL Server? Wh… Read more Parse Querystring In Sql Server 2005

Query For My First Row Admin For Never Delete

Possible Duplicate: How to prevent deletion of the first row in table (PostgreSQL)? i have a tabl… Read more Query For My First Row Admin For Never Delete

Sql Query Works In Pl/sql But Not In Visual Studio

I searched online and found out many had the same problem, but non of the solutions worked for me. … Read more Sql Query Works In Pl/sql But Not In Visual Studio

Sqliteopenhelper "oncreate" Is Not Called? (the Db Does Not Exist)

From a fragment I instantiate this way fmdata = new FileManagerData(getActivity()); the following … Read more Sqliteopenhelper "oncreate" Is Not Called? (the Db Does Not Exist)

How To Return String Value From The Stored Procedure

Alter procedure S_Comp(@str1 varchar(20),@r varchar(100) out) as declare @str2 varchar(100) set @s… Read more How To Return String Value From The Stored Procedure

Selecting Latest Rows In Subgroups

I have the following table created by a join and some conditionals: product_id date 11111 … Read more Selecting Latest Rows In Subgroups