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
8 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, ...
1
vote
1answer
35 views

AND operator in ORDER BY clause

While debugging some code, I stumbled into an error pretty much like the following: SELECT * FROM person WHERE family_size > 3 ORDER BY birthday AND registered=0; The error is that the AND ...
3
votes
2answers
108 views

migrate all databases from one SQL server 2005 to another SQL SERVER 2005

We have a production SQL Server 2005 server on which we are hosting 200 databases. We want to host these databases on our new server. On new server SQL Server 2005 is installed and is ready. I want ...
0
votes
0answers
27 views

SqlServer: can one table's PK be the FK of two table's?

I have three tables project, users and proj_user. The PK of proj_user table is the FK of project and users table's pk e.g.(project_id,user_id) My question is, is it possible if the project_id and ...
0
votes
0answers
17 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 ...
-2
votes
1answer
42 views

SQL Server procedure optimisation

I need to optimize the procedure below (SQL Server 2008) and badly need help: I am thinking to reduce search space o Splitting the joins and create intermediate (smaller) results o Force the most ...
0
votes
0answers
16 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
17 views

Best Mysql Performance Booster for Large Datawarehouse

What are the most effective and efficient ways to improve the performance of mySQL DB hosting a large Datawarehouse. Please suggest the best methodologies and performance tweaks that should be there ...
1
vote
1answer
31 views

why doesn't this parameterized sql return anything while the non parameterized one does?

I have tried to use sql parameter on one of my queries and noticed when ever i do so, it just doesn't return anything! while the none parametrized one works just fine. Why is it ? None parametrized ...
2
votes
1answer
39 views

Sum Actual in different period

I have the following table test : test is a table that contains the number of week , start and end day of each week for a month WeekOfMonth StartDate EndDate 1 2014-05-01 ...
1
vote
2answers
183 views

What is causing my Transaction log to grow

The TLOG in my SQL Server 2008 is growing faster than usual. The DB has a Full recovery model and we have a TLOG backup every hour. Can you please write me or refer me to link that describes a way to ...
0
votes
1answer
7 views

Compare sysdate month with a column data

im application developer and we are using Oracle database for this project. I never used oracle before so i want some help to build a simple query. I have a CARD table with these columns EXPIREMONTH ...
0
votes
0answers
10 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 of decreasing length and which returns an array of ...
0
votes
2answers
84 views

Alternatives for a LEFT OUTER JOIN query

Problem I have a SQL statement with an LEFT OUTER JOIN which works fine on our Microsoft SQL Server. My problem is that i have to be compatible with H2 Database and this one got a bug with OUTER ...
0
votes
0answers
20 views

Checks before Altering a column in SQL SERVER [on hold]

What are the checks that has to be done before dropping a column or altering a column.. like dropping the constraints, statistics etc.. on it
0
votes
1answer
28 views

SQL Server: compare names ignoring non-alpha

I have a database table with a text column "title". New rows are inserted all the time, and every time I would like to check for potential duplicates on this column. I define duplicate by "having the ...
1
vote
0answers
52 views

How to use join with this query?

This query is working fine, and giving the right result. In this query all columns are in one table, but now I have made some changes. Now columns named Semester and Major are in different Table ...
0
votes
1answer
7 views

How to check mysql password change and other events logs

Recently someone change my phpmyadmin password and drop database I think it was sql injecting. Now I want to find information about this like when, how and who change my password Please tell me ...
0
votes
1answer
14 views

The number of copies for each table stored in physical storage

I am new to Postgres and the database field. My question is that how many copies of each table are stored in physical storage device (memory, disk and so on)? I assume we need more than one copies for ...
0
votes
0answers
15 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 ...
2
votes
2answers
50 views

Unexpected result from query based on old column value

I need to update a column and based on the old value, update a second column. After googling I came up with THIS (*nr 4) solution: copy the table to have the old value at hand. The table looks like ...
0
votes
0answers
6 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
3answers
55 views

How to resolve stored procedure output parameter error?

Stored procedure displays the following error: Procedure or function 'getFavoriteList' expects parameter '@category_name', which was not supplied. The code: ALTER PROCEDURE ...
-1
votes
1answer
27 views

How do I select data with a case statement and group by?

I'm trying to manipulate data a little by using a case statement but can't seem to figure it out. Stops -------------------- 1Stop 1-Stop 1 stop 1 Stop 1stop 1 Stop 2-Stop Im trying to come up ...
0
votes
2answers
78 views

Tsql Query speed slow due to Or within where clause, causing index scan instead of seek

I have been working on making this query work more efficiently. I found that the number of Ors within the where clause are the biggest problem within this query. This query sits in a stored ...
1
vote
1answer
25 views

How to find non utf8 data in mysql

Ok so I have a mysql database containing data that is input from various customers. The customers are told that their data should only be encoded as utf8 however I have become aware that this is ...
1
vote
0answers
50 views

DB Design: Looking for Performance improvement with a Column used in all SQL Queries

I recently got added to a new ASP .NET Project(A web application) .There were recent performance issues with the application, and I am in a team with their current task to Optimize some slow running ...
0
votes
0answers
4 views

Set method to change StartMode property using SqlServer.Management.Smo.Wmi.Service

I'm trying to change SQL server Configuration manager settings using Microsoft.SqlServer.Management.Smo.Wmi.Service. Microsoft provided with a list of methods & properties here. I used the ...
0
votes
1answer
30 views

SELECT count vs DELETE JOIN. Why/how are they different?

Can someone explain in what way these queries could be different and the results are not the same? > begin; Query OK, 0 rows affected (0.01 sec) >select count(*) from tableA a JOIN tableB ...
0
votes
0answers
36 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 ...
0
votes
2answers
40 views

Calculating average with AVG for a list of numbers

This is probably a newbie question (bear with me) but how can I calculate the average for a list of numbers using SQL and the AVG function? I mean, I can add together numbers in SQL like: SELECT ...
0
votes
0answers
37 views

Is it possible to learn (and make a career out of) SQL without official training? [closed]

I'm really interested in learning SQL (SQL server or Oracle) as I already have a bit of experience with the databases at work (mostly select statements). I don't have a technical background since I ...
1
vote
0answers
18 views

Optimization suggestions for db2 materialized view

I have a view for db2 9.7 which has consolidated o/p from few tables. The view is built and it is working fine I want optimization suggestions on the view SQL CREATE VIEW XYZZ AS SELECT ...
0
votes
0answers
22 views

SQL query to fetch results for multiple many to many relationship tables

We are developing a database for storing licensedetails of source code, archives, shareobjects, binary. We parse a detailed build and extract list of source files that make objects, list of objects ...
-1
votes
0answers
12 views

single column data output multiple column group by value [closed]

i have a table with column name type_of_ house in which value is 1,2,3 the meaning of 1 is normal,2 is institute and 3 is other . output should be in three column name normal,institute and other with ...
0
votes
0answers
11 views

How to join 2 tables and traverse up hierarchy at the same time

Any help that can be given on a current problem I'm having in an Oracle environment would be greatly appreciated. I have 2 tables. One contains jobs to be performed on pieces of equipment, the other ...
1
vote
0answers
28 views

Creating table with foreign key and index using sqlcmd.exe and batch file [closed]

I need to create a new table in the database which also has got a few Indexes and Foreign Keys associated. The create script needs to be run using the sqlcmd.exe in a batch file. Assume in the batch ...
0
votes
0answers
13 views

MySQL hook and alter incoming INSERT queries?

We have an application running on a server which parses an xml data feed into SQL queries and executes them continually 24/7. There is a serious issue in the design of the queries and we need to ...
1
vote
2answers
31 views

Unable to SQL => Getting content of last 7 days

I thought I was good with SQL till I was told to get the content of all 30 days. I do have a column called "connect_time" which has date and time in the following format: 2014-08-28 11:11:42 All my ...
0
votes
0answers
33 views

split single column data into multiple columns using sql [on hold]

sir i have a column in a table say category in which values (SC,ST,GEN) and i want a output as a how many SC,ST,GEN etc in a single row example with a different column Category SC ST ...
0
votes
1answer
35 views

Returning value of insert

I am using Npgsql and I want to be able to do an insert, and if statement that will do an update and then return a value so when ExecuteScalar is called it reads that value. This was done fine in ...
0
votes
0answers
7 views

Netezza Error Record size 120000 exceeds internal limit of 65535 bytes

I have a column PARAM that has JSON data that looks like this: JSON:{"Name":"RES_InformationalIssues","StepName":"Page_1","StepData":"f601e9fe-d68a-4ed7-bbaa-f40c9cbc4d12=General Product ...
0
votes
0answers
10 views

pre-process, anonymize, data before creating a dump from sql-server [closed]

I would like to be able to automatically create dumps from a production machine (SQL-Server 2008R2 and up). In those dumps some data needs to be anonymized (mainly by scrambling nvarchar-fields) so no ...
0
votes
1answer
37 views

Alternative to sub query in MS Access

I'm looking into the possibilities for writing queries in MS Access, as my client currently uses Access and would be reluctant to move away to SQL Server. I've been using the data macros (which are ...
0
votes
1answer
55 views

Why isn't this index helping my InnoDB MySQL query?

I'm having trouble understanding why an index I have on one of my tables is doing nothing to help the performance of a JOIN, even when forcing the index. Here is the query: EXPLAIN SELECT * FROM ...
2
votes
1answer
48 views

Adding Indexes To a Partitioned table in SQL Server 2012

I have recently converted our one large table to use table partitioning in SQL Server 2012. It's a table that stores logs based on a time. So I created a partition function to split the table on my ...
0
votes
0answers
26 views

Cant Normalize my dimensions and fact table, need help

I have a task at school that I can't get my head around. The task is to create some dimetables and create a facttable from those. The data I have chosen is from Export and Import cost for each year ...
0
votes
1answer
26 views

How to include in the result of a `SELECT … GROUP BY …` all the other columns that are functionally dependent on the grouping ones?

I'll base this question on a toy example. Let this be table A: A ------------------------- U | V | W | X | Y | Z ------------------------- a | b | c | 1 | 6 | 8.3 a | b | c | 1 | 4 | ...
4
votes
1answer
43 views

Encoding Debug UTF8 & Latin 1

We have on our DB some international people that got some characters saved incorrectly on our DB (MS SQL-Server 2008 R2). For example we have strings like 'WilcoxonÃ'. We got this data into ...
1
vote
0answers
17 views

Oracle - physical writes to an index

We have a large UPDATE (affects about 200K records) on a huge table (80M records). Due to a coding mistake, the UPDATE updates the same set of rows (200K) all over again with the exact same value. ...