Questions tagged as 'sql'

0
answers

query database with related tables

Reformulate the question: I have a database with several tables and I want to make a query where I imply several. The problem is that he tells me that one of the columns does not find it. It is not from the "main" table but from one of the on...
asked by 03.04.2018 / 16:50
1
answer

Error Code 1215 foreign key in mysql

I'm having problems with three FKs. It is an N: N relationship that points to its PK. All have the same type (SMALLINT) This is the table where I have to put those FK CREATE TABLE IF NOT EXISTS result( municipalityID SMALLINT, districtID...
asked by 07.03.2018 / 17:12
0
answers

Create Array in a stored procedure

I am migrating a stored procedure from Oracle to Sql server and I have this problem. It turns out that they occupy a varray within the code. I do not know how to do it in SQL. Searching for different pages, some recommend that a table be made...
asked by 12.02.2018 / 23:43
1
answer

Subquery - Group By - SQLite

Ok, I have two Queries, the first one I ask for the names of the clients and I order them alphabetically: SELECT Firstname, Lastname FROM customers ORDER BY Firstname In the second I request the total of purchases: Select Custom...
asked by 13.02.2018 / 05:14
4
answers

Problem with query in sql

I find myself consulting a database in sql, however, it has sent me the following error    ORA-00979: not to GROUP BY expression I have 3 tables in my database, product table, buyer table and sales table, with which I have been working. M...
asked by 21.02.2018 / 09:15
0
answers

Error in PostgreSQL LANGUAGE SQL

When trying to create the following function: CREATE OR REPLACE FUNCTION public.sp_busqueda_dgv_ta( v_valor character varying ) RETURNS table(ID INTEGER, NOMBRE VARCHAR(500)) LANGUAGE 'sql' COST 100 VOLATILE ROWS 1000 AS $BODY$ IF TRIM(V_VAL...
asked by 21.02.2018 / 17:29
0
answers

Parallel Period filter (MDX)

If we have the following query in the [Adventure Works] cube of the BD AdventureWorksDW2014 : WITH MEMBER [Measures].[Previo] AS ( [Date].[Calendar].currentmember.PrevMember,[Measures].[Customer Count]) MEMBER [Measures].[Paral...
asked by 31.01.2018 / 21:12
2
answers

SQL TRANSACTIONS

A query, I have a procedure with transaction handling, in which several INSERT must be executed, as I do to know in which INSERT I failed the procedure in such a way that I can show in the RAISERROR message something like "error to insert...
asked by 26.01.2018 / 21:02
1
answer

Connect Query Sql Server

Good afternoon, what happens to me is that I have a query on sql server and when I stop working on the query for a while it disconnects and when reconnecting it does not let me execute the code I have, does anyone know how I can reconnect it?  ...
asked by 25.01.2018 / 20:23
0
answers

How to prevent logging when the php sql server page is updated

Dear, I would like you to help me, I'm doing an insert with php and sql server for which you register correctly but the problem is that when I update the page you register how I can avoid that. this is my code: <table class="table">...
asked by 03.02.2018 / 16:04