All Questions

0
votes
0answers
2 views

How to get the SUM between dates in a WHERE clause?

I'm trying to get the SUM between each date in the WHERE clause of the following query, not the cummulative sum, but the sum for the period in between the dates. For example: Query: SELECT ...
1
vote
1answer
8 views

Joining two Mysql VIEWs takes a very long time

I have a textbox (for which I used jQuery auto-completion) in my PHP form where user can insert an actor/actress name and then by clicking "Search" button, a new window is opened showing list of ...
0
votes
0answers
14 views

how to combine two queries?

I can't explain this very well except by spelling it out. I start a query on ID, and from there I can get TITLE, DATE, and REGNUMBER. The problem is I also want to get 'where,' which is also stored ...
-2
votes
0answers
28 views

Joining Multiple Tables in Sql Query [on hold]

I have four tables with their attributes; namely Check_Gauge, Storage_Facility, Product, Product_Brought. The first three tables are related through their primary keys. Product_Brought is not ...
0
votes
1answer
9 views

MySQL table indexes change location

Is it possible to move the MySQL Table indexes to another location rather than "datadir" ? for example a ssd drive or memory partition ?
0
votes
1answer
17 views

Slow query performance on simple select

I have 2 tables: Organization (2.500.000 rows) City (35.000 rows) 'Organization' has 'city_id' set as foreign key to 'cities'.'id': Organization: ALTER TABLE public.organization ADD CONSTRAINT ...
0
votes
1answer
18 views

01/01/1753 date is corrupt in Excel after export from SSRS

The date 01/01/1753 appears fine in the SSRS 208R2 report preview, but when the report is exported to Excel 2010, it appears as ########### and the value in the cell is -53689. All other dates come ...
1
vote
2answers
30 views

How can I simplify this UNION?

Here's the case - I have the following query: SELECT DISTINCT post_id FROM ( ( SELECT DISTINCT rp.post_id, pm.meta_value AS premiere_date FROM wp_related_people AS rp JOIN ...
1
vote
2answers
25 views

Associating on the ID of an association table

Sorry about the title, I couldn't find anything better. Suggestions are welcome. Say we have two tables, Suppliers and Products. The same product can come from many different suppliers, so we create ...
0
votes
2answers
29 views

Remove duplicates and connect relations to the first one

Guess I can use some help over here. I have split a products table into two tables, products and prices. This is the original table: products: +----+--------+-----------+-----------+-----------+ | ...
0
votes
0answers
6 views

MySQL no query cache hits

My database have been up and running for a while with query cache enabled, but there are 0 hits. I have tried to check the settings but I am not sure what the problem is. Using InnoDB. mysql> SHOW ...
0
votes
0answers
7 views

How to handle filenotfound condition in java agent running and reading files 24*7 [migrated]

I am having application which runs 24*7 Its java standalone application. it reads log file line by line from configured location. When it doesn't find log file, then it just put exception statck ...
0
votes
2answers
18 views

Allowing users access to SQLPLUS and to compile PLSQL

As a DBA - assuming my users are knowledgeable with PLSQL and SQL - why would I not grant my users privileges to compile and run their own PLSQL code. We have an MI database environment where the data ...
0
votes
0answers
13 views

Postgresql dynamic execute with arguments values in array

I'm wondering if this is possible in posgresql: Best explained using a contrived example: create or replace function test_function(filter_param1 varchar default null, filter_param2 varchar default ...
0
votes
2answers
17 views

Schema/Structure to handle secondary computed data

I'm trying to design a LAMP-based website for my pinball league, which plays competitive pinball every week in match play. One of the features of our league is that we convert raw scores to ...
0
votes
0answers
11 views

How to replace empty, multi-column result with single 'none'

If it is possible to make query in Oracle which will return single column/row with value "none" instead of empty, multi-column result? Otherwise return proper amount of columns with result. This is ...
0
votes
0answers
11 views

Convert a list into one row with dynamic column in MySQL [duplicate]

I have a list of row to be converted into a dynamic column that depends on the record in one particular column. From this statement FID |Steps | Action ---- |------|-------- 1416 | 1 | Sit ...
0
votes
1answer
8 views

Replication on same physical server

I am new to DB. We have galera cluster on Test environment where mariaDB is replicated in 3 servers. Now customer want us to work with only 1 server. they cant provide 3. Can we do replication on ...
1
vote
0answers
16 views

Running query crashes postgresql server

I'm running into a strange problem which I can't solve. The server crashes when executing some postgis related queries. After some debugging, using the examples provided by postgis, it appears the ...
2
votes
2answers
13 views

Do Postgres GIN indexes need to be rebuilt periodically?

Do they get bloated like btree indexes? If so how can the bloat be measured e.g. by an automated reindexing script. I am interested in improving query performance and saving space.
1
vote
0answers
16 views

Wich is the most efficient/easy way for end-user to get data from Analysis database?

I know that you can quey a cube by connecting from excel to Analysis database and using formulas like cubevalue() or cubemember(). I also know that after converting the power pivot to formulas you can ...
0
votes
2answers
8 views

Query to Secondary on Sharded Cluster

How to specify query from mongos shell which is inteded to query data from secondary? The goal is not to bother primary load on write and use data in secondary shards instead.
1
vote
0answers
15 views

SQL Statements truncated in log files

Does PostgreSQL cut statements if there is a subselect in it? We use log_min_duration_statement = 20ms to find statements which need a long time. But unfortunately the statements are truncated: ...
5
votes
1answer
211 views

How can I check for stored procedure consistency across multiples servers

I've got a stored procedure on 10 distinct servers, how can I check across all servers for stored procedure consistency? I'm currently pulling the definition for each server manually, and comparing ...
0
votes
1answer
14 views

Is there any way to use “like” operator during oracle table partitioning

I am using Oracle 11g database and I have 45 million records. I want to partition the table, but if it's possible for partitioning to support the like operator then it will be much helpful for me. In ...
0
votes
2answers
24 views

Outer Joins to find records with no matching associated entries

I'm trying to find all foo records which do not have any bar records that match a given criteria. create table foo ( id integer ); create table bar ( foo_id integer, name varchar(255) ); ...
0
votes
1answer
14 views

WordPress MySQL writes during “Flush Tables With Read Lock” are rejected instead of being queued

I'm running into an odd issue when setting MySQL into a brief read-only mode for backup. Reads continue fine during that "read only" minute, but writes are just rejected instead of being queued to ...
0
votes
0answers
14 views

Migration error: “Invalid date literal detected” when reading decimal

I'm attempting a migration from MSSQL to MySQL and keep coming across a "Invalid date literal detected" error when reading certain decimal columns. I'm running the following (all up-to-date as of ...
0
votes
1answer
11 views

How to design tables for airbnb style booking system

all. My English is not very good, but I will try to describe my question as clear as possible. I want to design a airbnb(https://www.airbnb.com) style booking system, this kind of booking system ...
0
votes
1answer
25 views

How to query sum all the wins of each team

Matches ID| radiant_name | dire_name | radiant_win 1 | LV | LGD | true 2 | LGD | LV | false 3 | LV | LGD | false 4 | LV | LGD | false ...
0
votes
0answers
5 views

phpmyadmin Password reset probleme

I restored my website from an internal automatic backup provided by the host in apache (Cpanel) server. Since i cant access my phpmyadmin and when i try to reset the password i get this error: ...
0
votes
1answer
32 views

Taking the difference in timestamps between successive entries

This is my first foray into DBA.stackexchange, so I'll say up front: this is a query optimization question. If this is not an appropriate question for DBA, let me know and I'll skulk away quietly... ...
0
votes
1answer
8 views

75% of RAM for Innodb_buffer_pool size

I have read many documentation including percona and MariaDB documentation where they recommend setting innodb_buffer_pool_size to 70-80% of RAM. My question is, is that total RAM or available RAM? ...
1
vote
2answers
47 views

How to update a column with values from the same newly inserted row on a SQL Server 2014 trigger?

Using SQL Server 2014, I have this: Table1 Tab1_id int identity(1,1) primary key Tab1_val1 smallint Tab1_val2 smallint Tab1_valInfo varchar(10) -- not yet implemented, will be used ...
1
vote
0answers
11 views

Is this update, select combination query thread safe?

I have a table called seats, which has a schema like this id,taken For each user, I take a random untaken id and assign to that user, here for simplicity say, I make taken =1. The query I am ...
1
vote
3answers
43 views

Running two DELETE statements causes a syntax error

DELETE `member` FROM `member` WHERE `member`.`type_id` = 1; DELETE `subscriptions` FROM `subscriptions` WHERE `subscriptions`.`type_id` = 1; Table: subscriptions ...
1
vote
1answer
28 views

Marking duplicate records

I have a list of things, some of which are duplicates. create table things ( id int primary key, title text not null, author text not null, duplicate_of int null references things(id) ); ...
0
votes
0answers
23 views

SQL Server spending a lot of time creating sp_dbmmonitorupdate

I have an SQL Server 2008 R2 Standard with around 80 databases, 18 of which are a synchronous mirror primary. I'm having a lot of complaints about database speed lately, so I've started digging with ...
0
votes
0answers
4 views

SCD2 loading With Merge but without delete (multiple if matched)

Hoping someone can solve an issue for me. I'm very new to sql in general but with some research I've completed nearly 75% of the task. Basically, I need to compare an incoming file against my fact ...
1
vote
1answer
143 views

Why do nonclustered Indexes use clustered indexes instead of the table data pages directly?

From a Microsoft Course (presented by a third party) I learned that when a table has a clustered index even non-clustered indexes hit the clustered index. When there is not a clustered index (Heap) ...
1
vote
1answer
17 views

How to restrict access to current user record and its rights in postgres

Postgres 9 database contains additional information about postgres users: create table public.user ( user char(10) primary key, -- CURRENT_USER in postgres name char(30) ); and user roles; ...
0
votes
0answers
11 views

MySQL Remote Database Failover: Need Advice

I run a network of sites all on 1 server. To improve performance, I'm (finally) moving the MySQL database to a remote machine. I'd love anyone's advice on how to appropriately approach failover. ...
1
vote
1answer
9 views

How to UPDATE/DELETE/INSERT with Microsoft.ACE.OLEDB.12.0 as Linked Server in SQL Server 2012?

I need to update an Access 2003 database from SQL Server 2012 with the Microsoft.ACE.OLEDB.12.0 provider. As an administrator, everything works great. I can do Select, Insert, Update and Delete ...
1
vote
0answers
8 views

DB2 zOS increasing DSSIZE vs adding partition?

I'm trying to load data into a DB2 table. The tablespace has 3 partitions with about 60M,60M,70M rows. The 3rd partition is failing to load. It gives me a warning that loading this partition's dataset ...
0
votes
1answer
7 views

MongoDB Tag-Aware Sharding Workflow

I wonder the work flow of sharding cluster in Tag-Aware Sharding. --- Sharding Status --- sharding version: { "_id" : 1, "version" : 3, "minCompatibleVersion" : 3, "currentVersion" ...
0
votes
0answers
19 views

View Constraints in SSMS

I am new to working with SSMS. How do I view Constraints on a table. I tried right clicking on the table and selecting Design. Then clicking on Table Designer menu and Check Constraints. When I go ...
1
vote
2answers
59 views

Using sp_BlitzIndex - Diagnosed as “Index Hoarder: Addicted to nulls” [duplicate]

Context: MS SQL Server 2012 In using Kendra Little's awesome tool, sp_BlitzIndex, a number of tables were diagnosed as "Index Hoarder: Addicted to nulls". I'm not looking for a debate over NULLs and ...
1
vote
0answers
20 views

Migrate from SQLite to MySQL (then back)

For various reasons, I must use a SQLite database with a local application. However, I wrote a Flask app that enables users to more easily classify items in the database, and it runs very slow on ...
0
votes
0answers
20 views

MySQL 5.6.19a InnoDB Concurrent Insert

I've looked through most of the threads on this topic but still had question I was hoping someone would be gracious enough to help with. I am seeing low CPU usage and write latency but transaction ...
2
votes
1answer
24 views

How can one select a static value as a column based when using UNPIVOT?

I'm trying to unpivot a few columns in a table. This is for a reporting tool. The source data is already normalized. I am able to get my desired results with a series of UNION ALL statements. I can ...

15 30 50 per page