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

Complicated Sql Query For A Running Total Column

I'm trying to work out a pretty complex query in SQL Server 2008. I'd like some input from… Read more Complicated Sql Query For A Running Total Column

How To Delete All Tables With Prefix "bkp" From A Given Database?

I have a SQL server 2005. In that server I have 3 databases -> a,b,c. If I want to delete tables… Read more How To Delete All Tables With Prefix "bkp" From A Given Database?

Pivot Multiple Rows

I have a table similar to the following: id key str_val date_val num_val 1 A … Read more Pivot Multiple Rows

T-sql Remove Zero Padding As String Manipulation

If you are dealing with strings as nvarchar and varchar in SQL Server what is the correct way to dr… Read more T-sql Remove Zero Padding As String Manipulation

Convert '7-apr-11' To Dd-mm-yyyy In Sqlite

I'm trying to convert a date that has the month stored in 3 characters to a workable date forma… Read more Convert '7-apr-11' To Dd-mm-yyyy In Sqlite

Are Single Quotes Escaped Automatically In Php? Then What's The Need For Cleaning?

I'm reading up on web security and one obvious topic to cover is SQL injections. I'm trying… Read more Are Single Quotes Escaped Automatically In Php? Then What's The Need For Cleaning?

Stored Procedure Taking 4 Hours To Run

Below is my stored procedure. I am performing some basic calculations. it used to run faster before… Read more Stored Procedure Taking 4 Hours To Run

Sql Drop Constraint Unique Not Working

I got the following table: CREATE TABLE `unsub_counts` ( `count_id` int(11) NOT NULL AUTO_INCREMEN… Read more Sql Drop Constraint Unique Not Working

Mysql Select By Best Match With Like

I have this query: SELECT `id` FROM `accounts` WHERE AES_DECRYPT(`email`, :salt) = CONCAT_WS('… Read more Mysql Select By Best Match With Like

Postgresql Stynax Error Creating Function

I am creating a function in my PostgreSQL but I'm getting this syntax error and I ran out of id… Read more Postgresql Stynax Error Creating Function

Sql: Is Results Order Mapped To Values In 'in' Expression?

I have a list of record IDs for which I want to retrieve a single value from a table in SQL Server … Read more Sql: Is Results Order Mapped To Values In 'in' Expression?

Check If Column Value Is Numeric. Ssis

I have a column with datatype of varchar. I would like to replace all the values that are not numer… Read more Check If Column Value Is Numeric. Ssis

How Can We Do Pagination In Fetching The Value With 100 Records Each In Sql

How can we do fetching first 100 records next 100 records then next and so on in SQl Server from a … Read more How Can We Do Pagination In Fetching The Value With 100 Records Each In Sql

How To Get Sequence Number Of Row Using Entity Framework?

I have SQL query: WITH OrderedRecs AS (select ROW_NUMBER() OVER(ORDER BY RecID) as seqNumber,* from… Read more How To Get Sequence Number Of Row Using Entity Framework?

Sql Dynamic Order By Using Alias

Using SQL Server, I can order a normal SELECT query using an alias: SELECT u.FirstName + '… Read more Sql Dynamic Order By Using Alias

Insert Dictionary Sqlite3 (python)

New to sqlite and having trouble with the syntax. I need to iterate through each key of a dictiona… Read more Insert Dictionary Sqlite3 (python)

How To Use Soundex With Sqlite In Android

Could someone please guide me on how to use soundex in sqlite. or can we use 'soundex' func… Read more How To Use Soundex With Sqlite In Android

Sqlalchemy Connect To Vps Database

I am trying to connect to VPS mysql database from my PC. I use sqlalchemy framework, but I need est… Read more Sqlalchemy Connect To Vps Database

Double Inner Join In Access Db

I need to get some data from two tables, 1 people, 2 tasks, The following query in SQL works, and A… Read more Double Inner Join In Access Db

Sql Server : How Many Days Each Item Was In Each State

Given a table that stores every revision for every item. For example: +--------+----------+-------… Read more Sql Server : How Many Days Each Item Was In Each State

Is There A Way To Do Another Query Within The Insert Query?

Ok so this is the query I have...I just added the ACCOUNTID and the @accountID portion which is obv… Read more Is There A Way To Do Another Query Within The Insert Query?

Build Insert Statement Error Https Has Already Been Declared

I have a method which takes multiple images from the UI and stores them in the cache, when this has… Read more Build Insert Statement Error Https Has Already Been Declared

Serial-like Int Column

I have an app where depending on the type of transaction being added or updated, the ticket number … Read more Serial-like Int Column

How To Stop Sql Injection Vulnerability?

Was wondering how vulnerable this was to SQL injection. I heard that using prepared sql statements … Read more How To Stop Sql Injection Vulnerability?

Working With Dates In Access Using Pyodbc Giving "too Few Parameters" Error

I am using Python with a pyodbc import. I am using Microsoft Office 2013 64bit. I am attempting to … Read more Working With Dates In Access Using Pyodbc Giving "too Few Parameters" Error

Mysql Update Column Then Select Updated Value

I have a table like this tbl_user id user_id amount first i want to update a row based on id $amou… Read more Mysql Update Column Then Select Updated Value

How To Fetch Records Using Vertical Columns In Amazon Redshift

I need to fetch records between the date range given in two columns. My Table structure is like: CR… Read more How To Fetch Records Using Vertical Columns In Amazon Redshift

How To Get Return Value From Procedure Sql Server 2005 To C#

CREATE PROCEDURE [dbo].[Code] @intEpmName NUMERIC, @strFailedEMPID VARCHAR(… Read more How To Get Return Value From Procedure Sql Server 2005 To C#

Using Shared Library In Gyp In Node-sqlite3

I'm new to Gyp. Instead of compiling my dependency, I would like to use a shared library, in pa… Read more Using Shared Library In Gyp In Node-sqlite3

Pdo Dblib Not Working

I have a connection with the DBLIB PDO driver, and I am not getting any errors on connecting, but w… Read more Pdo Dblib Not Working

Sql Server: Group Query Based On Substring Of Column

I need to get a substring from a column 'source' from typeTable and be able to get stats on… Read more Sql Server: Group Query Based On Substring Of Column

Spark Dataframe Not Appending To The Table

I am unable to append to a table when writing to a table using dataframe write Here is the command … Read more Spark Dataframe Not Appending To The Table

Is It Possible To Use Autoscaler For Google Sql As It Is Possible For Compute Engine

Let me explain the problem. I have a magento project with 3 million products and more than 6 millio… Read more Is It Possible To Use Autoscaler For Google Sql As It Is Possible For Compute Engine

Order By Relationship Properties Neo4j

Using Neo4j 1.9.3 - I want to create a music program listing. On a given program there may be three… Read more Order By Relationship Properties Neo4j

How Can I Extract Date From Epoch Time In Bigquery Sql

I have date stored in Epoch Time and I want to extract Date from it. I tried the code below and I g… Read more How Can I Extract Date From Epoch Time In Bigquery Sql

How To Select Specific Data Between Quotes (")

I am reposting my question as I am new to SQL 2012. I want to fetch the numeric data between quotes… Read more How To Select Specific Data Between Quotes (")

Find The Missing Entries For The Working Days And Fill The Row With The Values From The Closest Date

The problem splits into two parts. How to check which working days are missing from my database, if… Read more Find The Missing Entries For The Working Days And Fill The Row With The Values From The Closest Date

Sqlldr.exe Not Working For Windows 10

I have recently installed Oracle Database Client (12.1.0.2.0)(winx64) with Custom installation and … Read more Sqlldr.exe Not Working For Windows 10

Like Query On Values Of Map Elementcollection In Entity In Hql

I have an entity named « Form » that contains a Map « details » of (key/value)=(language code/trans… Read more Like Query On Values Of Map Elementcollection In Entity In Hql

T-sql Multiple Grouping

I have follwing data : Product Price StartDate EndDate Apples 4.9 2010-03… Read more T-sql Multiple Grouping

Optimizing Mysql Queries With In Operator

I have a MySQL database with a fairly large table where the products are. Each of them has its own … Read more Optimizing Mysql Queries With In Operator

Fetch Refcursor Into Temporary Table

I need fetch refcursor into temporary table. Each refcursor column should match appropriate table c… Read more Fetch Refcursor Into Temporary Table

Sql Union Question

Can someone explain to me why the SQL statement: SELECT 'TEST1' UNION SELECT 'TEST2'… Read more Sql Union Question

How To Pass Two Sql Tables As Input Parameter For R Codes In Sql Server

I am running r codes in SQL Server. I have two tables in SQL Server database that I would like to p… Read more How To Pass Two Sql Tables As Input Parameter For R Codes In Sql Server

Order By Clause Conflicts With Distinct In Access?

Please help me with this as I have been unable to get past this problem When trying to execute this… Read more Order By Clause Conflicts With Distinct In Access?

Implementing The Room Database (android)

I like to know how to properly integrate the Room Library within an Android Application. Some artic… Read more Implementing The Room Database (android)

Finding If Current Row Is Last Row To Be Selected From Database

I am selecting list of periods from database. If current row is first row then the period starts wi… Read more Finding If Current Row Is Last Row To Be Selected From Database

Ddl Commands Are Autocommit In Sql Server, What Does It Mean?

at most pages I have read that 'DDL commands have AutoCommit in SQL Server', if I am not wr… Read more Ddl Commands Are Autocommit In Sql Server, What Does It Mean?

Sqlpackage.exe Publish Conjunction Exception

I'm trying to use sqlpackage tool for publish thought CMD: sqlpackage /action:Publish /SourceFi… Read more Sqlpackage.exe Publish Conjunction Exception

Selecting Entries That Are Numerically Close To Each Other In A Database

Lets say I have a table called ABC in a MS-Access Database. There are several columns in this table… Read more Selecting Entries That Are Numerically Close To Each Other In A Database

What Is The Syntax For Adding Multiple Arguments Onto The "variables" Parameter In Sqlpackage.exe?

I am using SqlPackage.exe for my deployment. I have read the documentation here for the usage of S… Read more What Is The Syntax For Adding Multiple Arguments Onto The "variables" Parameter In Sqlpackage.exe?

Ranking Within Multiple Groups & Efficient Query For Multiple Table Updates

I'm trying to add rank by sales by month and also change the date column to a 'month end… Read more Ranking Within Multiple Groups & Efficient Query For Multiple Table Updates

Best Way To Join Parent And Child Tables

I have Parent table A. A has few child tables such as B,C,D,E,F,G The child tables are not linked t… Read more Best Way To Join Parent And Child Tables