All Questions

Filter by
Sorted by
Tagged with
0
votes
0answers
2 views

Many to many relationship, select rows based on values in list

I want to select group_runs based on a list of group_runners.player and I'm having issue getting rid of results that don't have all the values on that list. In this case group_runs with id = 2 shouldn'...
0
votes
0answers
7 views

While testing our workload on SQL 2019 we experience much higher CPU utilization compare to the same test on SQL 2014

We are getting ready to upgrade our SQL 2014 systems to SQL Server 2019. As part of our due diligence we created a workload which we are testing against both systems. What we have observed was the ...
-3
votes
0answers
14 views

Update and Select in real time SQL Server

I am with SQL Server, and I need a solution to update several tables and, at a same time, select queries in real-time. I know this could be blocked by another user if you make one of this operations. ...
0
votes
0answers
19 views

SQL sql subquery with SUM for totals

I am a little stuck on getting a total value for a column using the SUM function. I want to get the total amount of items for an order from my database. The DB order is made up of several line items ...
2
votes
1answer
22 views

Do SQL OS Background Tasks Yield to Normal Tasks?

I have a SQL Server 2019 server that is running at about 22% CPU. I look at what's running and I see that about half of that 22% is coming from background tasks (i.e. the status is "background&...
-1
votes
1answer
7 views

Upgrade to 10.3 resulted in deleting configuration from old version

We've recently upgraded MariaDB from 10.1 to 10.3 from Cpanel. After the upgrade we started to having issues in the INSERT clauses where we use INSERT into table values ('','one') where the first ...
0
votes
0answers
11 views

Oracle: Keeping exact db clone synced up in real time

Is there a way to keep an exact clone of a database in real-time? (Or very close to real time) The use case is for data reporting. I'm currently limited in it to make sure the application performance ...
0
votes
0answers
14 views

How do I write a query that gives me 2 results from the same table?

I wonder if anyone can help me with this at all, I'm a complete novice here! The call center I manage uses FreePBX as a phone system and try as I might I have not been able to find a solution for a ...
0
votes
0answers
31 views

How to prevent/detect fetching data from another server

I have discovered a problem in our development where I need some help. We had some reports developed by an outsourced person, and now I am cleaning up his mess. The biggest problem is that he has ...
0
votes
1answer
11 views

How to find the counts of word occurrences in a column?

I have a column containing text in postgresql. Now I want to find, for a given input word, the counts of occurrences of the word in my text column. So I have date_col | text_col -------------+----...
-1
votes
0answers
17 views

Index with mixed int and char columns is slow

I have been optimising a complex query with multiple joins; currently down to 0.003 seconds. But I have joined to a table with a mixed index (int, char), which tanks execution time down to 0.3 seconds....
0
votes
1answer
9 views

How to get percentage after grouping?

I have a table like this: person_id food data 1 bread xxx 1 bread xxx 1 fruite xxx 2 bread xxx 2 fruite xxx food can have only three values (bread, ...
0
votes
0answers
2 views

Modify number of file WiredTigerLog in mogodb

How can I modify the number of WiredTigerPreplog and WiredTigerLog in journal directory ? There are allways 2 WiredTigerPrepl and 1 WiredTigerLog. Thanks MongoDB : "version": "4.4.4&...
0
votes
0answers
7 views

PostgreSQL cascading triggers based on the condition of which other table triggered it or a value given by the other trigger?

I want to keep (slightly different) tables synced to one another and with only 2 tables, this is fine. Because of pg_trigger_depth() = 0 in the WHEN clause they will not trigger each other. I ...
0
votes
0answers
4 views

How to select more than 20 rows in SPHINX engine?

I use SphinxSE instead of FULLTEXT. Sphinx settings are for end-users of a search engine. According to the official documentation, LIMIT clause. Both LIMIT N and LIMIT M,N forms are supported. Unlike ...
0
votes
0answers
15 views

Track usage of views and set up logging

I set up a database with some views. I want to log who accessed which view and when. The target-table looks like this: [schema], [table], [user], [timestamp] dbo, access, someuser, 2021-04-13 12:07:...
0
votes
0answers
4 views

PgPool setup with remote master and local read replica

I have working two server postgres setup with local (in docker) replica and remote (via VPN) master. Without enabled load balancing everything (all queries) are redirected to master with enabled load ...
0
votes
2answers
20 views

Finding “one of” entries to a composite key/index

Problem: Assuming I have a table like this: CREATE TABLE `test` ( `id` bigint unsigned NOT NULL AUTO_INCREMENT, `a_id` bigint unsigned NOT NULL, `b_id` bigint unsigned NOT NULL, `c_id` bigint ...
0
votes
0answers
5 views

Does it make sense to separate records in a document DB (e.g. DynamoDB) for better query performance?

I've recently started working with DynamoDB, and most of my experience is in traditional data warehousing (e.g. sql server). One common pattern which I saw when working with SQL server was that we ...
0
votes
0answers
12 views

Cannot use 'STWithin' as it can't be found for type 'Microsoft.SqlServer.Types.SqlGeography' (SQL Server V14)

I am currently using the STIntersects method to spatially match a geographic point to a geographic area. I am working with Geography types here not Geometry. Historic code from the place I work shows ...
0
votes
0answers
9 views

Join one row to multiple rows in another table

i have two tables "apartment" and rooms Apartment Table: id Apartment 1 abc Room Table: id apartment_id room_name 1 1 abc1 2 1 abc2 2 1 abc2 now I want to display 1 row in PHP but in ...
1
vote
1answer
18 views

Select distance between cities in two directions

I have a distance table and a cities table. I have joined them in a way where i now have: cityA_id,city_A,cityB_id,cityB, distance in km i need to get the distance betweens cityA and CITY B and then ...
0
votes
0answers
8 views

interactive database with depent combobox

I have to do a tool to fill by user. User must from three "dimension" choose one "area". "Area" is divided on "problems" and output is choice one "problem&...
0
votes
1answer
9 views

MySQL - Call a View inside a Stored Procedure

Let's say, I have a table as follows tbl_1 id name status usertype flag ===============================================================...
0
votes
0answers
7 views

Hybernate or stream for DateRange[]?

Is it better to use flows (java.util.stream) or the Hybernate library to retrieve objects from the database? For example, I have a table with a DateRange[] attribute. What should I use?
0
votes
1answer
22 views

How do I identify functional dependencies and normalize a table based on the attributes?

I'm having trouble identifying the combination of attributes which make up Functional Dependencies(FDs) of a particular table. While I understand how Normalization process works when given the FDs, I'...
0
votes
1answer
22 views

In which table should the receipt column be?

We have a system, when a user adds a new record, they have to pay a specific amount. But if they want to modify the existing record, they can update it only twice without having to pay. However, each ...
0
votes
0answers
13 views

MongoDB - Robo3t: Failed to do query, no good nodes, Field 'cursor' must be a nested object

When viewing documents of a collection and trying to move between pages using "left" and "right" arrow buttons: suddenly started to get the following error in Robo3T: Failed to ...
2
votes
0answers
12 views

Autotask 'auto optimizer stats collection' and scheduler jobs logging

We have a DB hosting Peoplesoft schema, with more than 33.000 tables. Since december Oracle has left more than 18 thousand of them with no statistics renewed: SQL> select to_char(last_analyzed,'...
0
votes
0answers
11 views

How to setup replication of 150Gb mysql database

I have 150Gb database on running project. How to create replication for it without minimum downtime? All manuals say: lock database, export data, import data at new server, configure and start ...
0
votes
1answer
21 views

MySQL return rows ONLY if ALL the rows in another table have a specified value

I have two tables Table1 : efd_details( id ) Table2 : efd_detail_status( detail_id , status ) Now the data as following : select * from efd_details; Output : ID 1 2 3 4 5 select * from ...
0
votes
1answer
15 views

MySql ORDER BY slow with join, fast as 2 queries

Why is the following query slow but fast when I provide the values inline? select u.* from user u join user_group g on u.group_id = g.id where g.account_id = 1 order by u.id limit 10; -- takes ~30ms ...
0
votes
1answer
10 views

Checking if entities match an id in on relation where it could show up in either of two columns

The problem I'm trying to make a page for a website (with PostgreSQL database) that allows the owner of a group to add new members from their friends list. Given the owner_id of a Group its group_id I ...
0
votes
1answer
41 views

I am wanting to use UDTT in my database, but we have CLR turned off, and according to the docs for create type, all types require a CLR assembly

Is this true? Or can I use User defined Table Types with having CLR off? (I.e. they don't require the use of CLR) If they do require CLR, is there an alternative I can use for my stored procedure ...
0
votes
1answer
7 views

Adding underscore(_) in a record in Oracle table

I want to add underscore (_) for around 4000 records in one of table. How can I achieve this?? Note : Records are present in table like this "I am Yash" and I want to change it like this &...
4
votes
3answers
286 views

MS SQL Server 2014: which stored procedure is my error in?

As a general question or three on Microsoft SQL Server 2014, that perhaps I should know the answer to already, or even perhaps did once - When my stored procedures run other stored procedures, how can ...
-2
votes
1answer
23 views

Iterate through a list of strings In SQL scriipt

I'm trying to create a sql file that iterates through a list and get me the information from a group of servers and save it on CSV file. The DB is Oracle, just in case :S. I'm running the file using ...
0
votes
0answers
4 views

presto from_unixtime to omit milliseconds & timezone string

This is my query SELECT from_unixtime(dispo_epoch,'Africa/Johannesburg') FROM "analytics"."table1" WHERE lead_id = 100000 Result returned is: 2020-03-31 12:37:43.000 Africa/...
0
votes
1answer
6 views

Monitor network traffic per client

I'm investigating intermittent performance issues on a database running MariaDB 10.4 and I notice extraordinarily high network traffic. Bytes_sent is about 20TB after running for 58 hours (379GB per ...
0
votes
2answers
38 views

Best way to determine Dev/Test/Prod environment in MS SQL Server 2012+?

We have 3 MS SQL Environments: Dev, Test, and Prod. There are many Dev servers, and 1 each in Test and Prod. What is the best way to determine the "Environment" from a query? For instance, ...
0
votes
1answer
21 views

Transaction Log backup in MSSQL's HADR

I'm a resident developer who is voluntold to be a database admin of MSSQL 2016. Please bear with me as I'm still trying to self taught the art of DB admin. I recently setup a DR solution using the ...
0
votes
0answers
15 views

connect to remote PostgresDB through VPN

I am not very advanced DB Admin/User, know only basics. Though as developer I need to have a direct access to a production-deployed database by using my VPN configuration so that I wouldn't need to ...
0
votes
0answers
10 views

How can I tell SQLDeveloper which Oracle jdbc driver to use?

I need to connect to an Oracle 9i server from my machine using SQLDeveloper. I already have a functioning version of SQLDeveloper 18.2 + Oracle Client 12, but for this connection I want a seperate ...
0
votes
0answers
16 views

Postgres insert fails silently

I have a table with about 7000 rows defined CREATE TABLE public.cage ( cage_id serial NOT NULL, location_id int4 NOT NULL, "name" text NULL, lon numeric(11,8) NOT NULL, lat numeric(10,8) NOT ...
0
votes
0answers
4 views

DB2 for i setting connection specific collation

I read an answer to a question that said you can set connection-specific collation for a DB2 for i connection. However, my Google skills are failing me and I can't find anything about it. Specifically,...
0
votes
1answer
42 views

Powershell script executed by SQL Server doesn't take effect

I'm doing some testing and I want to execute a PowerShell script through xp_cmdshell. Below is the PowerShell script (c:\temp\sqltotext.ps1). echo "haha" | Out-File "c:\temp\haha.txt&...
2
votes
0answers
30 views

Researching Performance Degradation on AO Secondary using MultipleActiveResultSets (MARS)

Environment: SQL Server 2016 Enterprise Edition on Windows 6.3 9600 two node cluster with Always-On. We have an application that executes SELECTs on the only secondary node of a SQL Server 2016 always-...
0
votes
0answers
33 views

Convert a numeric number to a letter PostgreSQL

i have this function : https://dbfiddle.uk/?rdbms=postgres_12&fiddle=22a67dedd54291d7ffb527e2f9d482ca this function retrieve only integer part, i want to retrieve also decimal part. i tried : ...
0
votes
2answers
19 views

Passing parameters in MySql procedure with prepare execute

I am trying to write a procedure that has a location parameter, this parameter is later used in the queries inside the procedure. Also, I want to be able to limit the query results dynamically. I have ...
0
votes
1answer
12 views

Postgresql schema does not exist

This query works fine. select icca.invoice_id as "DR Inv Reference", icca.total_ex as "Line Tax Exclusive", icca.total_inc as "Line Tax Inclusive", icca....

15 30 50 per page
1
2 3 4 5
1794