Questions tagged [sql]

Structured Query Language (SQL) is a language for querying databases. Questions should include code examples, table structure, sample data, and a tag for the DBMS implementation (e.g. MySQL, PostgreSQL, Oracle, MS SQL Server, IBM DB2, etc.) being used. If your question relates solely to a specific DBMS (uses specific extensions/features), use that DBMS's tag instead. Answers to questions tagged with SQL should use ISO/IEC standard SQL.

142,548 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
18votes
1answer
474views

ODCIAggregateMerge without parallel_enabled

These are quotes from Oracle docs: [Optional] Merge by combining the two aggregation contexts and return a single context. This operation combines the results of aggregation over subsets in order ...
user avatar
  • 877
16votes
3answers
3kviews

SQL - Chat database schema to delete conversation for one side or both

I am designing a chat database with the next requirements: Only private messages, A to B. No groups nor rooms. When user A send message to B, if user A deletes conversation, user B still be able to ...
user avatar
  • 418
15votes
3answers
2kviews

Entity Framework 4 Generate Database From Model With Multiple Schemas

I am using EntityFramework 4 with POCO classes, but I like to divide the database up into separate schemas. While I can do this by designing the database first and then generating the model and ...
user avatar
  • 2,901
13votes
0answers
571views

SAP Sybase SQL Anywhere NullReference Exception when openening and closing many connections in a service

Currently I've the problem, that SAP Sybase SQL Anywhere throws randomly NullReference Exceptions in a service, which executes a lot of sql queries. The conenctions are always created in a using block ...
user avatar
  • 17.8k
13votes
1answer
4kviews

Data Mining Operation using SQL Query (Fuzzy Apriori Algorithm) - Coding it using SQL

So I have this Table: Trans_ID Name Fuzzy_Value Total_Item 100 I1 0.33333333 3 100 I2 0.33333333 3 100 I5 0.33333333 3 200 ...
user avatar
  • 234
12votes
1answer
910views

GIN Index has O(N^2) complexity for array overlap operator?

I ran into an issue with using the && array operator on a GIN index of mine. Basically I have a query that looks like this: SELECT * FROM example WHERE keys && ARRAY[1,2,3,...] This ...
user avatar
12votes
1answer
655views

SQLite External Content FTS requires rebuild every time?

I set up an external content FTS4 virtual table in my app to allow full text search of an existing database. I also set up triggers similar to the documentation, so when my main content table is ...
user avatar
12votes
2answers
1kviews

Doctrine - Multiple models referencing same id field in another model

I have a Files Model, and Multiple (currently 3) different other Models (Article, Job, Event) that can all have files, that are stored in the Files Model. The problem is that when i generate the ...
user avatar
  • 3,780
12votes
2answers
330views

Rows Rotation For Mysql Table Consumer Process in Round Robin

We have automation to login into different websites and perform some operations on website accounts. It is required that only one BOT can login simultaneously into a specific account to avoid ...
user avatar
12votes
2answers
18kviews

Easy way to convert data table to hash table or sqldatareader to hashtable

Is there an easy way to convert a DataTable to a HashTable or a SQLDataReader to a HashTable? I have to parse it through javascriptserializer. The code I am using has some problems: try { using (...
user avatar
  • 129
11votes
1answer
5kviews

How to create an empty array of struct in hive?

I have a view in Hive 1.1.0, based on a condition, it should return an empty array or an array of struct<name: string, jobslots: int> Here is my code: select case when <condition> ...
user avatar
  • 807
11votes
3answers
1kviews

Azure SQL stored procedure ridiculously slow called from C#

Summary: We have two identical databases, one on a local server, one on Azure. We have a C# system that accesses these databases, calling stored procedures. The stored procedures are running very, ...
user avatar
  • 552
10votes
0answers
307views

Some Unicode space category characters are not being replaced by TRANSLATE or REPLACE

I have the defined a function dbo.ufnRemoveSpaceCharacters to remove all characters under the Unicode category Zs (Space Characters). All 17 of the characters able to be replaced/translated using ...
user avatar
10votes
3answers
649views

Sequelize query with a where clause on an include of an include

I'm struggling to create a query with sequelize. Some context I have the following models: A Manifestation can have [0..n] Event An Event belongs to one Manifestation (an Event cannot exist without ...
user avatar
10votes
2answers
1kviews

Entity Framework 6, Command Interception & Stored Procedures

I was asked to develop auditing for a system at my work. The system has already been completed. I think EF 6's Command Interception should work well for my purposes. However, there are situations ...
user avatar
  • 669

15 30 50 per page
1
2 3 4 5
9504