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

Subqueries Are Not Allowed After Values?

INSERT INTO t_MT_User (ID, Badge, Name, Scope, comp_code, dept_code, [status]) VALUES ((SELECT MAX… Read more Subqueries Are Not Allowed After Values?

How To Limit An Sql Query To Return At Most One Of Something?

I have a table in my database representing releases of software; the relevant columns of the schema… Read more How To Limit An Sql Query To Return At Most One Of Something?

Php Sql Select Where In Array Of Ids And Has Same Variable Column Value

So I have a table kind of like the one below. +----+----------+---------+ | ID | group_id | user_id… Read more Php Sql Select Where In Array Of Ids And Has Same Variable Column Value

Sql Server Query To Get The Number Of Business Days Between 2 Dates, Excluding Holidays

We are using SQL Server. In our CASE WHEN statement, I need to check if the number of days between … Read more Sql Server Query To Get The Number Of Business Days Between 2 Dates, Excluding Holidays

Assemblies In Sql Server Keep Unloading And Loading Again Periodically

SQL Server keeps loading and unloading my Assemblies, marking them as unsafe. Any ideas why it woul… Read more Assemblies In Sql Server Keep Unloading And Loading Again Periodically

Trouble Accessing With Procedure In Sqlfiddle

I'm building a query in SQLFiddle using SQL Server 2008. This query is a procedure that selects… Read more Trouble Accessing With Procedure In Sqlfiddle

Access Sql Filter Query By Date For Two Values

I have an expression that shows the total inventory before all orders in and out: (Query3 just com… Read more Access Sql Filter Query By Date For Two Values

"must Declare Scalar Variable" Error

Must declare the scalar variable '@Id' SqlConnection con = new SqlConnection(@'connect… Read more "must Declare Scalar Variable" Error

Returning 1 Or 0 In Specific Sql Query

I have three columns in the table MYTABLE (ID, NUM, NAMES). There is a column NAMES. I need to chec… Read more Returning 1 Or 0 In Specific Sql Query

Youtube Embed Code Stored In Database Not Appearing In Html Form

I have an UPDATE php page to edit a websites database that contains Youtube's embed code which … Read more Youtube Embed Code Stored In Database Not Appearing In Html Form

Data Warehouse - Slowly Changing Dimensions With Many To Many Relationships

As an example, let's say I have a fact table with two dimensions and one measure FactMoney tabl… Read more Data Warehouse - Slowly Changing Dimensions With Many To Many Relationships

Dynamic Pivot Table With Column And Row Totals In Sql Server 2012

I have table RPT_DailySalesSummary with column CalDate, OrderID, SalesAmount, LocRecID. CalDate … Read more Dynamic Pivot Table With Column And Row Totals In Sql Server 2012

Do I Substract 1 From 45 Each Time A Student Registers For A Seat?

I have 2 fieldnames on 2 different tables. One fieldname is called SeatCapacity. This fieldname nam… Read more Do I Substract 1 From 45 Each Time A Student Registers For A Seat?

How Can I Save Multiple Choice Values In A Sql-table? How Should Be The Table Like?

how can I save the multiple choice values in a SQL-Table? Is that possible at all? I have to save t… Read more How Can I Save Multiple Choice Values In A Sql-table? How Should Be The Table Like?

What Is The Date Type In Npgsql?

I am using postgreSQL database. I need to add 'Date' parametres with SQL query. What do I h… Read more What Is The Date Type In Npgsql?

Mysql To Select Max Value Between On And Off Time Stamps Plus 3 Seconds

There's a transporter inlet valve sensor which data is collected to a MySQL DB table showing th… Read more Mysql To Select Max Value Between On And Off Time Stamps Plus 3 Seconds

Stored Procedure Does Not Return Anything

It is should be no problem to find but after long hours at my job I cannot notice what I'm doin… Read more Stored Procedure Does Not Return Anything

Get Clock In And Clock Out Time From Multiple Clock In Or Multiple Clock Out In Sql Server

I am working in web application to manage staff with clock in/out time and mapping with planned shi… Read more Get Clock In And Clock Out Time From Multiple Clock In Or Multiple Clock Out In Sql Server

Do I Have To Close The Sql Connection Manually If I Use Linq?

Traditionally, when we use SQL string to done some work, we have to close the sql connection before… Read more Do I Have To Close The Sql Connection Manually If I Use Linq?

If Exists Update Else Insert In One Query

I have simple table like this: +----------+---------------+-------------+ | ID (int) | KEY (varchar… Read more If Exists Update Else Insert In One Query

Distinct Values From An Array?

Following tables: CREATE TEMPORARY TABLE guys ( guy_id integer primary key, guy text ); CREATE TEMP… Read more Distinct Values From An Array?

How To Remove The Quotes From A String For Sql Query In Python?

I have a dictionary of database names. I take a name from the dictionary database_name = database_… Read more How To Remove The Quotes From A String For Sql Query In Python?

Left Join Not Giving The Null Values In The Table Sql

--Changed the query to new syntax hence posting as new----- I have created a query to retrieve empl… Read more Left Join Not Giving The Null Values In The Table Sql

Why Most Sql Databases Allow Defining The Same Index Twice?

Why most SQL databases allow defining the same index (or constraint) twice? For example in MySQL I … Read more Why Most Sql Databases Allow Defining The Same Index Twice?

Mysql's Wait_timeout Incorrect In Sqlyog

Following this question, I set the following MySQL parameter in C:\Program Files\MySQL\MySQL Server… Read more Mysql's Wait_timeout Incorrect In Sqlyog

Mysql Finding Min/max Values For Double

The relevant MySQL documentation states that for doubles: Permissible values are -1.79769313486231… Read more Mysql Finding Min/max Values For Double

Sql Join Using A Join Table From Rails

So, I am not sure what the best way to do a join for these tables was. I want to use a JOIN because… Read more Sql Join Using A Join Table From Rails

Mysql Select From Table, Get Newest/last 10 Rows In Table

What's the best, and easiest way to do this? My query currently is: SELECT * FROM chat … Read more Mysql Select From Table, Get Newest/last 10 Rows In Table

Insert And Update With Core Sqlalchemy

I have a database that I don't have metadata or orm classes for (the database already exists). … Read more Insert And Update With Core Sqlalchemy

Android Sqlite Added Extra Columns Now Can't View Data

I had this previously working with only two of the parameters, 'Weight' and Waist', I t… Read more Android Sqlite Added Extra Columns Now Can't View Data

Using Variable With Dynamic Sql

Hi I am using Dynamic Query in My store Procedure Using following syntax ` set @query =N… Read more Using Variable With Dynamic Sql

Replace Part Of String With Capitalised Equivalent From Cross Ref Temp Table - Tsql

We have an issue with instrument names loaded into our data warehouse where they either loaded with… Read more Replace Part Of String With Capitalised Equivalent From Cross Ref Temp Table - Tsql

Sql Trigger On Insert To Call A Function And Manipulate Values

I am having a problem knowing set up a trigger on insert to call a function and passing an identifi… Read more Sql Trigger On Insert To Call A Function And Manipulate Values

Sql Server 2008 - Display Row Items In Column Without Pivot

I have three tables that store: TENANT, ROOMMATE and PERSON records. The schema is as below: Table:… Read more Sql Server 2008 - Display Row Items In Column Without Pivot

Why Aren't My Breakpoints Hitting Sql In Visual Studio 2019 Debugging Script From Network Server

So I am unfortunate enough to work in an organization who uses SSMS18, meaning I don't have the… Read more Why Aren't My Breakpoints Hitting Sql In Visual Studio 2019 Debugging Script From Network Server

Find Out Which Query Increasing Dtu In Sql Azure

I am using SQL Azure SQL Server for my App. The DB tier, which my app was in was working perfectly … Read more Find Out Which Query Increasing Dtu In Sql Azure

How To Get Nᵗʰ Highest Value Using Plain Sql

What is the simplest way to get the nth highest value from a result set using plain SQL? The result… Read more How To Get Nᵗʰ Highest Value Using Plain Sql

Datediff Sql Server 2016 Json

Currently have a startDate and EndDate formatted in JSON and trying to use a DATEDIFF function to w… Read more Datediff Sql Server 2016 Json

Group By And Sum

I am having trouble getting the sum of enrollment where the business_code is the same. My code is … Read more Group By And Sum

.net Sql New Table Doesn't Exist

NOTE: This issue has been resolved, but lead to a new question. I'm getting this error: Syste… Read more .net Sql New Table Doesn't Exist

Nvarchar Storing Characters Not Supported By Ucs-2 Encoding On Sql Server

By SQL Server's documentation (and legacy documentation), a nvarchar field without _SC collatio… Read more Nvarchar Storing Characters Not Supported By Ucs-2 Encoding On Sql Server

Convert Columns Of Data To Rows Of Data In Sql Server

I'm trying to learn how to import data from a csv file to my database and then reorganise it in… Read more Convert Columns Of Data To Rows Of Data In Sql Server

Private Chat System Mysql Query To Display Last Message Of Sender/receiver

Here I am extending my previous question. Private chat system MYSQL query ORDERBY and GROUPBY In ad… Read more Private Chat System Mysql Query To Display Last Message Of Sender/receiver

Having Several Sqliteopenhelper In One Appli Android

I would like to know if it is possible to have several DbOpenHelper in the same app Android but to … Read more Having Several Sqliteopenhelper In One Appli Android

Run A Script On Existing Database From Sql File In C#

I have created an empty database. I need to run script on this empty database. So far I have found … Read more Run A Script On Existing Database From Sql File In C#

Advanced Mysql Query To Get Master Record If Two Conditions Matches On Different Rows Of Child Records

I was writing a mysql filter query which has a primary table and another table which holds multiple… Read more Advanced Mysql Query To Get Master Record If Two Conditions Matches On Different Rows Of Child Records

Dropdown Selection Using Server Side Datatable | Php, Sql Server

I have a problem when selecting the dropdown in server-side data table. This is based on this examp… Read more Dropdown Selection Using Server Side Datatable | Php, Sql Server

How Do I Convert An Int To A Zero Padded String In T-sql?

Let's say I have an int with the value of 1. How can I convert that int to a zero padded string… Read more How Do I Convert An Int To A Zero Padded String In T-sql?

Stored Procedure To Find Free Slots With Different Work Times Per Day Of The Week

I am using the awesome stored procedure created by Aaron Bertrand here as a start since it almost d… Read more Stored Procedure To Find Free Slots With Different Work Times Per Day Of The Week

Saving Bytearray To Varbinary Column In Sql Server Inserts Only One Byte

I have a following problem - I'm trying to save byte[] to database and I just figured out that … Read more Saving Bytearray To Varbinary Column In Sql Server Inserts Only One Byte

How To Select Row By Primary Key, One Row 'above' And One Row 'below' By Other Column?

Ok, so I've got a 'users' table with an 'id' column and a 'score' colum… Read more How To Select Row By Primary Key, One Row 'above' And One Row 'below' By Other Column?

Update A Sorting Index Column To Move Items

If I have the following table & data to allow us to use the sort_index for sorting: CREATE TABL… Read more Update A Sorting Index Column To Move Items

How To Get Latest Record Or Record With Max Corresponding Date Of All Distinct Values In A Column In Mysql?

For Example, I have table like this: Date | Id | Total ----------------------- 2014-01-08 1 … Read more How To Get Latest Record Or Record With Max Corresponding Date Of All Distinct Values In A Column In Mysql?

Range Wildcard Pattern Matching Behaviour With Case-sensitive Collations

Using PATINDEX and a case-sensitive collation to search for upper-case letters in a string I notice… Read more Range Wildcard Pattern Matching Behaviour With Case-sensitive Collations

Looping Through Query Results Multiple Times With Mysqli_fetch_array?

Does the mysqli_fetch_array() function remove each value as it returns it? If not, how can I go bac… Read more Looping Through Query Results Multiple Times With Mysqli_fetch_array?