Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Welcome to Software Development on Codidact!

Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.

Posts tagged sql

13 child tags

Use for questions about one or multiple Structured Query Language (SQL) flavours.

In order to get the most helpful answer your question should include the following:

- a specific SQL flavor tag (e.g. for MySQL, PostgreSQL, Oracle, MS SQL Server, IBM DB2)
- table definitions
- sample data if needed
- expected result when query results are not what you expect

For general questions that are not targeting a specific SQL flavor, questions and answers should use ISO/IEC standard SQL.

This tag doesn't have a detailed wiki yet.

60%
+1 −0
Q&A Convert Synapse SQL Server hex `sid` to Azure Entra group object ID.

Suppose I have an Azure Synapse Serverless SQL database. I can run the following to get the sid of added groups: select name, type_desc, authentication_type_desc, sid from sys.database_principal...

0 answers  ·  posted 12d ago by daviewales‭

77%
+5 −0
Q&A How to break infinite loop in CTE

I have a parent-child relation in my table, with possibly circular cases. Is it possible to break the infinite recursion in CTE checking values of all previous rows? I would need something like thi...

3 answers  ·  posted 3y ago by artaxerxe‭  ·  edited 19d ago by Michael‭

71%
+3 −0
Q&A How to easily support time frame grouping in queries?

I had a curiosity about how much the experienced users wait for their questions to be answered on Stack Overflow and had written a query for it: SELECT YEAR(q.CreationDate) * 100 + MONTH(q.Creatio...

1 answer  ·  posted 3y ago by Alexei‭  ·  last activity 25d ago by Michael‭

25%
+0 −4
Q&A Having problems with my php script [closed]

The exam checking for the backend is working perfectly well but the front end keeps saying an error occurred. Am like ok then tried the demo version replaced the javascript and everything i can rep...

0 answers  ·  posted 4mo ago by zick853‭  ·  closed 4mo ago by Mithical‭

Question php mysql
75%
+4 −0
Q&A Wikidata: How do I ask for the start date of a property in SPARQL?

I have a SPARQL query to Wikidata that returns the names and handles and parties of politicians for whom a Mastodon address is stored at Wikidata. Filtered by nationality and with an output of the ...

0 answers  ·  posted 4mo ago by wasuko‭

Question SPARQL wikidata
50%
+2 −2
Q&A What is the default port number of MariaDB?

What is the default port number of MariaDB database server? (Remembering defaults is surprisingly hard since usually you don't need to specify them..)

1 answer  ·  posted 5mo ago by Iizuki‭  ·  last activity 5mo ago by manassehkatz‭

Question database port mariadb
60%
+4 −2
Q&A How to speed up MySQL query?

I have a website about vacation villa rentals. Around 800 properties are listed. When i start a search, i get properties with my first query which filters type, style, area, no. of rooms, capacity ...

2 answers  ·  posted 5mo ago by erenlerhakan‭  ·  last activity 5mo ago by ArtOfCode‭

Question php mysql
66%
+2 −0
Q&A Redshift int casting from varchar - how to force early evaluation order?

Context: I have a varchar column in a segment event table that contains version numbers. Most of these are formatted nicely as X.Y.Z (major.minor.patch) where X, Y, and Z are integers. However, the...

0 answers  ·  posted 7mo ago by Sigma‭

87%
+12 −0
Q&A Are there best practices for sticking conditions in WHERE clauses vs the JOIN statement?

Lets say I have two tables, A and B and I need to join a subset of them. Is there best practices of sticking the conditions in the WHERE clause like this, SELECT * FROM A JOIN B on a.fk_b = b....

3 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 7mo ago by billkarwin‭

Question mysql join
66%
+2 −0
Q&A Does Snowflake NATURAL JOIN support outer-style join?

I like using NATURAL JOIN in Snowflake, because I find it more elegant than explicit join clauses. However, it appears that the natural join behaves similar to an inner join, in that null values o...

1 answer  ·  posted 10mo ago by matthewsnyder‭  ·  edited 9mo ago by matthewsnyder‭

Question sql join snowflake
71%
+3 −0
Q&A How do I return ISO day of week in Redshift?

I have a query summarizing some transaction data that I'd like to summarize by day of week. For my use case, I need to return weekdays formatted according to ISO 8601, so Monday must be the first d...

1 answer  ·  posted 11mo ago by Sigma‭  ·  last activity 11mo ago by trichoplax‭

Question sql format redshift
71%
+3 −0
Q&A Updating the database reverses previous changes

The Code using Microsoft.EntityFrameworkCore; public class BloggingContext : DbContext { public DbSet<Blog> Blogs { get; set; } public DbSet<Post> Posts { get; set; } ...

2 answers  ·  posted 1y ago by Moshi‭  ·  last activity 12mo ago by FoggyFinder‭

50%
+0 −0
Q&A PHP code is not excluding the watched videos.

Can someone explain why this PHP code is not excluding the watched videos? The email_id parameter is used to specify the location of the watched videos array. The code should remove the watched_vi...

1 answer  ·  posted 1y ago by Collins ‭  ·  last activity 1y ago by dagelf‭

Question php mysql
42%
+1 −2
Q&A Why OFFSET isn't working the way it is expected?

I had three data with where gender=female. I was trying to call those data with limit and offset (Since in future there might be more than 1000 data). SELECT * FROM `users` WHERE `gender`='Female'...

1 answer  ·  posted 1y ago by billy‭  ·  edited 1y ago by Alexei‭

Question mysql sql
60%
+1 −0
Q&A VBScript Listener in SSRS

Is it possible to add listeners via VBScript/ JS directly into a SRSS report? Goal: Track changes of input fields and key press inside the wrapper React based on the events Directly in the...

0 answers  ·  posted 2y ago by Yolanda‭  ·  edited 2y ago by Alexei‭

50%
+0 −0
Q&A How to get rid of HTML tags and convert entities in SQL Server?

I have to migrate a bunch of text from an old application into a new one. Some of these texts contain HTML tags and entities (HTML editor was used) and now they do not want to support this in the n...

2 answers  ·  posted 2y ago by Alexei‭  ·  last activity 2y ago by gbjbaanb‭

Question html sql-server
71%
+3 −0
Q&A Conditions which always matches returns no result with CTE

I have the following scenario (in MySQL 8): CREATE TABLE `steps` ( `id` int NOT NULL AUTO_INCREMENT, `number` varchar(30) DEFAULT NULL, `parent_number` varchar(30) DEFAULT NULL, `timestamp` ti...

1 answer  ·  posted 2y ago by artaxerxe‭  ·  edited 2y ago by Alexei‭

77%
+5 −0
Q&A Is an ORDER BY required when looping through MySQL records with LIMIT?

Let's say I have a table with 10,000 rows and instead of selecting all of the rows at once I select 1,000 at a time like LIMIT 0,1000 LIMIT 1000,1000 etc. Without an ORDER BY statement the or...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  edited 2y ago by Alexei‭

66%
+2 −0
Q&A Rationale of using database-level transactions inside a store procedure when application layer already manages a transaction

One of the legacy applications my team has to maintain has almost always this pattern for dealing with data modification: try { // get the connection // begin transaction // optional...

0 answers  ·  posted 2y ago by Alexei‭  ·  edited 2y ago by Canina‭

80%
+6 −0
Q&A When stored procedures are preferred over application layer code?

A person I used to work with several years ago was hired to rewrite a product using a .NET-based modern tech stack. One of the aspects that stroke me was that he believes that the product should mo...

2 answers  ·  posted 2y ago by Alexei‭  ·  last activity 2y ago by Derek Elkins‭

71%
+3 −0
Q&A Transferring files from a legacy project to an existing one as varbinary

Our team is currently transferring all functionality (+ some changes) from small and very old project A (almost code freeze) to project B (actively developed). As part of the data migration, there ...

1 answer  ·  posted 2y ago by Alexei‭  ·  last activity 2y ago by Derek Elkins‭

50%
+0 −0
Q&A How to to make a store tree view cart

I am building an MVC cart system. I have the MERCHANTS table and the PRODUCTS table. A merchant (store) can have one or more products, everything works fine but what I want is to display products b...

0 answers  ·  posted 2y ago by Fyoni‭  ·  edited 2y ago by Alexei‭

Question php mysql pdo treeview
75%
+4 −0
Q&A What are the disadvantages of using SQL Server Replication - Transactional Replication type?

The context A reports related process is directly reading the production operational database once about two hours. This involves reading all the data from some 70 tables which takes a couple minu...

0 answers  ·  posted 2y ago by Alexei‭

71%
+3 −0
Q&A Is there any justification for having a single tempdb database to be used by all databases on a SQL Server intstances?

Despite the fact that I have programmed against SQL Server for quite a while I did not pay much attention to the tempdb database. This is especially true if application logic is mostly written usin...

1 answer  ·  posted 2y ago by Alexei‭  ·  last activity 2y ago by Derek Elkins‭

33%
+0 −2
Q&A Why comma is expected for auto_increment?

query = "CREATE TABLE "+TABLE+" ("+COLUMN1+" INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT, "+COLUMN2+" VARCHAR(255), " + COLUMN3+" VARCHAR(255), "+COLUMN4+" TEXT, "+ COLUMN5+" VARCHAR(255)...

1 answer  ·  posted 2y ago by Anonymous‭  ·  edited 2y ago by Alexei‭

66%
+2 −0
Q&A What's the better way to store base64 in SQLite Database?

What's the better way to store base64 in SQLite Database? I was thinking to put base64 as TEXT since base64 has lots of chars. CREATE TABLE name (id INTEGER PRIMARY KEY AUTO_INCREMENT, image TEXT)...

1 answer  ·  posted 2y ago by Anonymous‭  ·  edited 2y ago by Anonymous‭

Question sql base64 sqlite
71%
+3 −0
Q&A How to create a MySQL generated column that uses a join in a concat?

I have a column that is a concatenation of 5 other columns plus a join to a different table. UPDATE db.a JOIN db.b ON fk_b = b.pk SET concat_field = CONCAT(field1,field2,field3,b.field,field4,fi...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by Alexei‭

66%
+2 −0
Q&A How to start mysql in Manjaro from terminal?

I had installed mysql using the following command sudo pacman -Sy mysql Earlier, I was using Lampp(Xampp for Linux) where I could start using the command /opt/lampp/start start I am not sur...

1 answer  ·  posted 3y ago by deleted user  ·  last activity 3y ago by deleted user

60%
+1 −0
Q&A Is there any breaking change in regard to TrustServerCertificate property of System.Data.SqlClient for .NET 5?

I have recently an issue at work after upgrading an ASP.NET Core 3.1 application to .NET 5. It worked correctly on all environments (e.g. PreProd, Prod) when targeting 3.1, but failed on Prod only ...

1 answer  ·  posted 3y ago by Alexei‭  ·  last activity 3y ago by Alexei‭

50%
+0 −0
Q&A When is information schema not needed and when is it indeed when migrating from one website hosting provider to another?

In some situations, could it be problematic to migrate a website's database (MySQL) from one website hosting provider to another without the information schema or with the information schema? In m...

0 answers  ·  posted 3y ago by deleted user  ·  edited 3y ago by deleted user

Question mysql database
81%
+7 −0
Q&A SQL timestamp for daylight saving day when clock goes 1 hour back.

On 25th October 2020 in Europe/Berlin clocks where set back from 03:00 AM to 02:00 AM to change from summer time (CEDT) to winter time (CET). Which means there is a 1 hour separation between 02:30...

1 answer  ·  posted 3y ago by Estela‭  ·  last activity 3y ago by hkotsubo‭

66%
+2 −0
Q&A Is it possible to disable the "mysql: [Warning] Using a password on the command line interface can be insecure" warning?

For my purposes, it is secure enough to use passwords to execute MySQL commands on the command line, what I would like to do is disable the warning that says, mysql: [Warning] Using a password on ...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by Alexei‭

Question mysql
71%
+3 −0
Q&A What are the factors to consider when deciding to split ORM queries or use eager loading?

I have extensive working experience with Entity Framework ORM and have noticed two major ways of writing LINQ (LINQ2SQL): lot of eager loading: the most prevalent, uses (lots) of Includes to eag...

0 answers  ·  posted 3y ago by Alexei‭

75%
+10 −2
Q&A What are the pros and cons of a composite primary key versus a unique constraint?

Let's say we have two tables A and B and a join table C that has foreign keys to both A and B and the combination of those foreign keys is unique. One could either do a unique constraint or a comp...

2 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  edited 3y ago by Alexei‭

77%
+5 −0
Q&A Is it unsecure to use a password on the command line to run a MySQL script on Windows?

Its possible to execute a MySQL file from the command line like so, mysql -u USER -pPASSWORD < FILENAME which triggers a warning, mysql: [Warning] Using a password on the command line int...

2 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  edited 3y ago by ghost-in-the-zsh‭

Question mysql windows
66%
+2 −0
Q&A How much memory is allocated for a MySQL VARCHAR variable in a stored procedure?

In a stored procedure let's say I have a VARCHAR variable, DECLARE example_variable VARCHAR(100); how much memory is allocated to it and is that independent of the length of the data in the var...

2 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by Alexei‭

75%
+4 −0
Q&A Is there a way to automatically fix MySQL tables where the auto_increment has fallen behind the correct value?

Due to a series of unfortunate events I have some tables where the auto_increment value got behind what it should be. If the auto_increment value is 9 and there are 20 rows in the table the next 1...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by Alexei‭

71%
+3 −0
Q&A In MySQL is there a limit to the number of keys in a IN() clause?

I have a PHP program that does a SELECT and then updates some of the values based on an algorithm. Rather than updating one row at a time UPDATE example_table SET COLUMN_A = 1 WHERE primary_k...

2 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by Alexei‭

Question mysql
71%
+3 −0
Q&A Iterating through a MySQL table with a LIMIT clause and PHP gets progressively slower

I have a very large table that I need to iterate through with a PHP script and I can't do all of the results at once so I do it in sections with a LIMIT like for ($x = 0; $x < 10000000; $x += 1...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by ArtOfCode‭

Question php mysql
71%
+3 −0
Q&A Why would an unique index get moved to the primary key after the underlying column is dropped?

So I had a table with a primary key and a bunch of different columns. Columns A, B, and C were all unsigned ints (like the primary key column) and each column had a unique constraint I dropped the...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  edited 3y ago by Alexei‭

77%
+5 −0
Q&A Is it possible in MySQL to require each row in a table have at least one foreign key record in a join table?

I have tables A and B and then I have a many to many join table with foreign keys to both called a_b. Neither foreign key can be null and the combinations for the foreign keys to A and B are unique...

2 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by Alexei‭

Question mysql referential
50%
+0 −0
Q&A How to drop all stored procedures from a MySQL database

I need to drop all of the stored procedures from my MySQL database before I recreate them. How can I do so?

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  edited 3y ago by Peter Mortensen‭

71%
+3 −0
Q&A SID to login for access via a group

I have a query that returns the owner of jobs on an SQL instance, select s.name as JobName , s.owner_sid , ISNULL(L.name,'AccessViaGroup') as LoginName --Trying to figure out how to turn that ...

0 answers  ·  posted 3y ago by James Jenkins‭  ·  edited 3y ago by Alexei‭

60%
+1 −0
Q&A How can I can I reduce the size of a SQL Server database after being restored and massive embedded files stripped?

My project has the following set up for the production and preproduction ("clone") environment. Production is not accessible at all for the development team, only the preproduction database. Pr...

1 answer  ·  posted 3y ago by Alexei‭  ·  last activity 3y ago by Alexei‭

71%
+3 −0
Q&A How do I track down intermittent locks in a MySQL database?

Currently, we have a CRUD plus reporting application that talks to one MySQL database. Intermittently users will report locks when searching, currently, I can only get the approximate time of when ...

0 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  edited 3y ago by Alexei‭

66%
+2 −0
Q&A In MySQL, is it possible to disable triggers for only certain queries or users?

Almost every table in my DB has triggers that fire on INSERT, UPDATE, DELETE and write the changes to a separate read only DB. This makes it possible to track changes and undo things well after the...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  edited 3y ago by Alexei‭

80%
+6 −0
Q&A How are integers interpreted in contexts that expect a date?

I found a confusing construction in several stored procs in an MS SQL 2008 R2 database: DATEADD(dd, 0, DATEDIFF(dd, 0, some_date)) As I understand it, these are the relevant function signatures: D...

1 answer  ·  posted 3y ago by ajv‭  ·  edited 3y ago by Alexei‭

Question sql tsql sql-server
71%
+3 −0
Q&A How to calculate how much data is stored in a MySQL column?

I am considering either removing some columns or changing the datatypes if I could significantly reduce the amount of storage that is currently used by those columns. Some of the columns are ints a...

1 answer  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by Alexei‭

Question mysql
75%
+4 −0
Q&A Would a MySQL database run more efficiently with smaller varchar lengths?

I have a database with quite a few VARCHAR fields. When the database was first built the lengths of the columns were set a bit larger than absolutely necessary. Now after, having used the DB for a ...

3 answers  ·  posted 3y ago by Charlie Brumbaugh‭  ·  last activity 3y ago by manassehkatz‭

71%
+3 −0
Q&A Error: 18456, Severity: 14, State: 5; SSMS > Network sever from PC

I just completed my first install of SQL as a server-based, Enterprise Edition. I wanted to check it out using SSMS on PC using my Admin Access. But could not connect. For security reasons my adm...

1 answer  ·  posted 3y ago by James Jenkins‭  ·  edited 3y ago by Alexei‭