An acronym for "Structured Query Language", 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 access privileges.
0
votes
0answers
4 views
Why is this mysql query wrong?
I try to run the following sql query in mysql
SET @rank:=0;
WITH TEMP
(
SELECT @rank := @rank + 1 AS ROW_ID , UUID() as RANDOM_VALUE,D.*
FROM house_information_new D
ORDER BY ...
1
vote
1answer
15 views
Using a Having clause with an outer join
I want to use a "having" clause with an outer join, using a column that is used in the outer join.
This is my query:
SELECT
I.CARD_BIN BIN
FROM
GE_ICA_BIN I
LEFT OUTER JOIN GE_PAYEE_VALIDATION ...
0
votes
0answers
14 views
Range query from month and year [migrated]
I have a table like this:
ID month year content
1 4 2013 xxxxx
2 5 2013 yyyyy
3 6 2013 zzzzz
4 8 2014 fffff
I want to query it based on a year ...
0
votes
3answers
25 views
Transfer data from DB2 to Oracle
I want to transfer data from an old DB2 system to a new Oracle database.
How should I go about doing this?
0
votes
0answers
41 views
Complicated join with where clause
I have four tables:
sales
sales_thumbs
sales_images
sales_sizes
sales table:
+--------------+---------------------+------+-----+---------+----------------+
| Field | Type | ...
2
votes
1answer
58 views
Backing up SQL Server 2008 database in different recovery model
We currently have a production environment with 10 SQL Server 2008 databases in Full recovery mode (for obvious reasons). We back these databases up fully at a frequent interval, but due to the Full ...
1
vote
1answer
24 views
Trigger doesn't run when value of a column changes from null to 1
I have this trigger:
delimiter $$
create trigger tr
after update on t1
for each row
begin
if new.col1 !=old.col1
then update t2 set col2 =1 where t2.col3=t1.col3;
end if;
end
$$
This ...
-5
votes
2answers
75 views
Challenge: Build MySQL table that's not in first normal form [closed]
I have read numerous books and articles about database design and SQL in which it is said that a database should be in first normal form (1NF). (Some then go on to describe situations in which it may ...
0
votes
1answer
24 views
Find Underlying Data Type (int - integer) of Oracle Table instead of number
I can create an example table using following syntax.
CREATE TABLE "TABLE2" (
"COLUMN_INT" INT NOT NULL,
"COLUMN_INTEGER" INTEGER NOT NULL,
"COLUMN_SMALLINT" SMALLINT NOT NULL,
...
0
votes
0answers
10 views
Vote to a db server using session key
I do not know if this is the right stackexchange site to ask this question, but I believe that is relevant.
I am trying to implement an e-voting protocol. At some point the protocol says that server 1 ...
0
votes
1answer
42 views
Select first row (grouping) + add aggregate function
First have a look at this question on StackOverflow.
I'm looking to accomplish the same task, except I also need to add an aggregate function (PostGIS's ST_Union) to my query.
How can I combine the ...
1
vote
1answer
45 views
Can I use Try_Cast to give me a query result column with different datatypes?
I have a column that is varchar(max). It contains mostly valid XML. But sometimes it has invalid xml (that I still need).
I am trying to make a view for this table that allows the value to display ...
0
votes
1answer
14 views
“Replicate” sql structure between testing and staging on same database instance
On my local development server I have a database set up which gets hooked into Entity-Framework and is then used for unit testing. Let's call it COMPANY\Database
On the same server (and same database ...
2
votes
2answers
42 views
What can I do to make mysql use the expected indices?
What can I do to make mysql use the expected indices?
I've got 4 tables, two containing resources, and the others containing historical changes.
One pair uses indexes correctly, the other doesn't, ...
3
votes
0answers
25 views
SELECT COL_NAME(969262708, ORDINAL_POSITION) returns a NULL value in one of the rows
So I've got a Stored Procedure that's copying data from one table to another. It calls this other SP to get the column names. I didn't write this darn thing, but here's that part:
ALTER PROCEDURE ...