An acronym for "Structured Query Language" (it's not the name of a specific DBMS product), SQL can be used in relational database management systems (RDBMS) to query, update, delete, and insert data as well as modify the structure of the database. It can also be used to manage schemas and data ...

learn more… | top users | synonyms (1)

0
votes
0answers
28 views

SQL Query to get the Sales Qty of the Item and the its Returned Quantity for past 6 Months

I want retrieve the Sales Qty and return qty of the Items in the following format for the past six months. From two different tables,I TxnInvoice Table :Invoice header TxnInvoiceLine Table :Invoice ...
0
votes
0answers
26 views

Continuously copying an SQLite table

I have a SQLite database associated with an online application (Skype) on my computer, which is often changed by that application when I am using Internet. These are the columns of the database: ...
0
votes
0answers
26 views

problem in connecting SQL Server for internet access

I'm having a problem connecting SQL Server for internet access. I have built a test server so that I can play at home and not kill the works server. I've been trying for days and so far I have: My ...
0
votes
0answers
43 views

select sequential rows

How would I go about selecting a sequence of rows. Where every row in the sequence: Must only be 1 day apart ~ Thereby the whole sequence of rows must have sequential dates Must have a count higher ...
0
votes
0answers
58 views

Improving Statistics for Query Plan

I have a table with over 2.1 million rows. This table has a column rID, which joins to a PK on another table. As you can see from the distribution below, most rows contain a null for rID; which ...
0
votes
0answers
24 views

Left Outer Joins in Access

I'm working on an existing Access database trying to implement some changes which will allow the estimation of cutting times for my employer (We're an industrial company who fabricate Flight Cases). ...
0
votes
0answers
19 views

INSERT missing FK rows at the same time

I found on this site the following SQL-Query to perform an insert (see this post): WITH sel AS ( SELECT val.description, val.type, f.id AS foo_id FROM ( VALUES ('testing', ...
0
votes
0answers
12 views

Installing printer_php.dll onto an azure website

Has anyone been able to get this extension running on a php based azure website? The extension just basically allows you to print stuff with your printer. I've configured my php.ini to find the ...
0
votes
0answers
45 views

Table design for optimum performance

For example let's say I have to create a table called Employee with columns EmployeeID, Name, DOB, Address, DepartmentID[FK]. So I create the table as follows with a primary key and a nonclustered ...
0
votes
0answers
36 views

Secondary File Group is not online in SQL Server

In my database there are two file groups PRIMARY and SECONDARY. The .ndf file is in SECONDARY file group. I just wanted to backup only the secondary file group. So ran following T-SQL... BACKUP ...
0
votes
0answers
10 views

SQL Server 2008 R2 - Replication - Multiple Publications on a single database

I have hit a problem and I need an idea of where to look or how to resolve. I have setup a publication and 2 subscriptions to it, 1 running on a schedule and the other running continuously. I need ...
0
votes
0answers
40 views

Thoughts on further optimizations

So I have this application. It runs on a server. There is a portion of the code that is taking around 10-15 seconds to run, it contains some queries, logic, as well as some code to update the ...
0
votes
0answers
36 views

Should I create a Factless Fact Table or Denormalise my table

I am creating a data warehouse from a store database and I have a question regarding the design of my dimensions and facts. In the store database a table exists for Person, Person_Address and ...
0
votes
0answers
26 views

Paging via Number of Result Record vs COUNT(*)

I have been working on fixing a piece of code for a customer that has been very slow for them. I have made that fix, and thats all lovely, but I noticed something odd in the paging. When the query ...
0
votes
0answers
45 views

SQL Server : error 15208 Level 16, State 1, Line 1

Trying to Backup a certificate from SQL Server causes this error: Msg 15208, Level 16, State 1, Line 1 The certificate, asymmetric key, or private key file does not exist or has invalid format. ...
0
votes
0answers
34 views

Help writing the following query to relational algebra

Can someone help me in writing the following query to relational algebra, I am studying DBMS and I am stuck on this exercise. Query: SELECT a.name, d.name. d.grade FROM student a, enrolled i, class ...
0
votes
0answers
25 views

Crazy SSRS Issue

We are working a data center migration and are to the SSRS boxes and I am having trouble. SSRS is installed on a server alone pointing to the ReportServer and ReportServerTempDB on a different SQL ...
0
votes
0answers
20 views

How to insert a row which contains a foreign key in mysql

Here's the original question regarding PostgreSQL. I'd like to know of a similar solution for MySql. The simplest syntax provided in the answer works fine as long as the relevant rows already exist ...
0
votes
0answers
18 views

How can I import “.sql” file into a new database? (using Python or even IPython)

all! I have a "bakupdb.sql" file which contains tables from a web page (created with Django) and some data (that is inserted into the tables). It's a dump back up data. I don't have anything else - ...
0
votes
0answers
17 views

Intermittent MySQL 5.17 issues - extremely slow queries

I am experiencing major issues with intermittent mySQL issues. To give some background the website runs optimally for the majority of the time, however 3-4 times a day queries that should take a split ...
0
votes
0answers
21 views

MySQL performance_schema not working properly?

I have MySQL 5.6.19 community server running on my Ubuntu 14.04. Lately I have been trying to monitor MySQL server using performance_schema. Previously I used to do this by running SHOW FULL ...
0
votes
0answers
30 views

Where statement involving isnull/case

Here is my query: [SuggestedRetailPrice] > 0 AND (ISNULL( CASE WHEN [AdEnd] < GETDATE() THEN [AdPrice] END, [BasePrice]) )/[SuggestedRetailPrice] > 0.8 ...
0
votes
0answers
17 views

HSQLDB 1.8: Trying to have the result table contain two records in each row and be sorted

I'm really stuck doing this because each time I think I have a solution, HSQLDB v1.8 doesn't support it. I am forced to use this version at work, and believe me, I wish I could use a new DB, even v2.x ...
0
votes
0answers
14 views

How to import to UNIX the results from a select query?

After a select query i get around 14k records.Rather than exporting them as insert statements into a file and then executing from UNIX, i want to import them to UNIX directly and insert so as to save ...
0
votes
0answers
31 views

SQL: Dynamic Pivot Column, In the column's row value How to get Top 1 value

In my following query I need to get the top 1st record's value in pivot row value. So basically I get all parts and if there is a service entry with that part and a revision number I used that ...
0
votes
0answers
12 views

first query on my table takes apx: 0 sec but taking too much time on or after 3 to 4 query

I have the following table in mysql database: CREATE TABLE `chronologicallists` ( `sno` int(250) NOT NULL AUTO_INCREMENT, `empSno` int(11) NOT NULL COMMENT 'Employee Serial Number', ...
0
votes
0answers
26 views

Receiving duplicate results in one condition of JOINED query

I always end up here when Googling for solutions, so I thought I'd cut out the middleman since I'm unable to fix this via searching/forums. It's my first time posting, so please forgive any faux pas ...
0
votes
0answers
57 views

Accidentally deleted records in MS SQL Server 2014

I have a very big problem with SQL Server data lost. Recently, i have performed SQL replication. and i found out that all exising records/rows in the subscriber was totally erased and replaced by the ...
0
votes
0answers
68 views

Querying system tables from Linked Server

I am trying to query the syspublications table on Linked Server A from Server B. Both servers are running SQL Server 2012. Using this simple query on Server B: SELECT a.dest_table FROM ...
0
votes
0answers
29 views

mysql advanced query

I'm sorry for my English. I have a problem with db mysql. I have a table like this id|rat|time 1 |2 |12:00 2 |0 |12:55 3 |0 |13:05 4 |6 |13:45 5 |0 |14:00 6 |8 |15:00 7 |0 |16:30 8 |9 |17:00 ...
0
votes
0answers
66 views

SQL Mirroring synchronize logins and agent jobs

We have just started using SQL Server mirroring for several clients on SQL Server 2008 R2 Standard. We've got the SQL Server mirroring working fine however now we run into the issue of replicating ...
0
votes
0answers
17 views

Merge colums from two different databases using phpMyAdmin

Is there a way to: Replace all the data from database1 > table1 > column2 With Data from Database2 > table1 > column2 ONLY under the condition that the ID value in database1 > table1 > column1 ...
0
votes
0answers
80 views

Column encryption/decryption using encryptbykey

Working on a project where I need to encrypt a few sensitive columns in a table but make the data available through a procedure that a user can execute through either a report or excel. In looking ...
0
votes
0answers
68 views

Please anybody help me with oracle db importing?

I try to import .DMP file with impd comand. root@HP:~# impdp SYSTEM/xxxxxxxxx log=4.log file=as.DMP and i get this ;;; Import: Release 11.2.0.2.0 - Production on Thu Oct 2 12:21:14 2014 ...
0
votes
0answers
78 views

Intermittent errors when calling stored procedures with linked server references from SQL Agent jobs

Environment: Windows Server 2008 Standard without Hyper-V Service Pack 2 - 64 bit SQL Server Enterprise 2008 R2 SP2 - 10.50.4000.0 - 64 bit Problem: I am receiving intermittent failures from ...
0
votes
0answers
15 views

Assigning Parent Node Value using IDs

I am using iReport to build a report and I am trying to find the parent node "group_name" value based on a parent_id given, and return the value the parent, as the child's value. For example: Table: ...
0
votes
0answers
52 views

Update Duplicate record in select query of access

I have a select query (test) in access with below mentioned column ID 2561 2562 2563 2343 2561 2563 2563 Now in ID, i have duplicate records , for example here 2561 , 2562 , 2563 are ...
0
votes
0answers
30 views

MYSQL Tables Join Filtering For Favorites

I am in need of some help figuring out the best way to join separate tables I am using. I am essentially trying to output a list of schools (first table in MYSQL) where one column is an empty star ...
0
votes
0answers
30 views

How to store multiple vendor data in Google Cloud SQL?

I am designing a mobile app in which I need to host my vendor data and give access to that data after analysis to only the specified users. Since I will have multiple vendors with different set of ...
0
votes
0answers
21 views

pgAgent does not run

I referred this to set up a scheduled job and did everything as it mentioned(ran the pgagent.sql as well) I need a very simple task to run periodically. In the 'Definition' tab in the steps, few ...
0
votes
0answers
13 views

MySQL Replication problem with VIEWS and “Sub-Databases”

I've got three servers that should do a master-master replication. On server 1 i got "01_maindb" which holds the master tables. I replicate this table to the two other servers without problems. ...
0
votes
0answers
27 views

Accessing values of dymanic cloumn

I have a table which has 16 fields whose of alternate name to city. Below is my table structure: CREATE TABLE CITY_DATA_TO_CHK ( COUNTRY_CODE VARCHAR2 (100), REGION ...
0
votes
0answers
29 views

MS Access using MYSQL database and error in SQL (memo, hyperlink OLE)

I have a SQL statement that works fine in MYSQL workbench but when used in Access it produces a "invalid Memo, OLE or Hyperlink Object in subquery 'custom_values.value'. SELECT ccr1.value, ...
0
votes
0answers
23 views

Postgres - Combine similar queries with extra where clause

I am trying to combine a number of fairly time consuming queries into one (if possible) The database contains race-track data that records the times for laps completed by drivers (or users here), the ...
0
votes
0answers
23 views

Exporting data using SBIDS

I have created lots of SQL reports using Microsoft Visual studio (from BIDS as part of the SQL package). I am running 2008R. When I export the data I would like to export to Access instead of the ...
0
votes
0answers
24 views

Recursive query to break time intervals into standard-sized parts

I'd like to write a reusable function which takes 3 arguments a timestamp start_time a timestamp end_time an array of intervals interval_array such that each interval (except the first) divides the ...
0
votes
0answers
49 views

MySQL - Pivot-style (row -> column) results in subquery

SELECT j.departure, stopDepartures.* FROM journey j JOIN journey_day ON journey_day.journey = j.id JOIN service ON service.id = j.service JOIN pattern ON j.pattern = pattern.id JOIN ( SELECT ...
0
votes
0answers
18 views

Deploy Database to Windows Azure SQL Database show error in exporting database

When i try to deploy database to azure or export data tire application its successfully creating schema but it show error in exporting database
0
votes
0answers
10 views

Linked Server from SQL Server 2008 to Oracle not working

I have tried to make a linked server from SQL server 2008 to Oracle Server. I have successfully made a Linked Server from another machine to that oracle server but the one I'm making on my machine ...
0
votes
0answers
47 views

Emulate regex matching in ANSI SQL

I'm working in an ANSI SQL environment (no regex) on a script that is supposed to take the first 8-10 consecutive digits out of a text field that could: have alphanumeric characters, and some other ...