Questions tagged as 'sql'

1
answer

Substitute value within a query in postgresql

Good day. I have the following query: COPY (SELECT "UR_16PIX_Chih"."ID_UR", "UR_16PIX_Chih"."IDEDOMUN15", "UR_16PIX_Chih"."PIX1", "UR_16PIX_Chih"."PIX2", "UR_16PIX_Chih"."PIX3", "UR_16PIX_Chih"."PIX4", "UR_16PIX_Chih"."PIX5", "UR_16PIX...
asked by 17.04.2017 / 06:25
3
answers

SQL Server 2014 Job

I need please if you can give me ideas on how to solve the following: I have a database that I will call Principal that is in SQL Server , it imports information from other databases ( Oracle and SQL Server ) to show...
asked by 05.05.2017 / 21:01
1
answer

CREATE SCHEMA or DATABASE has a difference? and placing the CONSTRAINT before an FK is necessary?

I have those doubts in SQL .. It is a language that is not so strict and runs despite the different ways of writing it .. What exactly is the difference between CREATE SCHEMA and CREATE DATEBASE when I started to see the code generated by Workbe...
asked by 24.05.2017 / 01:05
2
answers

COUNT and complex query with INNER JOIN. (sql)

I have the comment tables, user, spam. The business logic, is that simple: a user can make comments, and this comments can be marked as spam by other users. The query I want to make must have the following structure: datos de comentarios...
asked by 07.04.2017 / 22:08
1
answer

Differences when executing stored procedure in local and server

I have the following stored procedure, which I run locally in Workbench and do what I need; however, I have the same database stored on a test server, and that's where I get the following message when I run it:    MySQL returned an empty resu...
asked by 28.03.2017 / 02:09
1
answer

Problem when granting permissions in DB-PostgreSQL

good day. I am having problems granting all permissions to a user on a database that I am creating. Use PostgreSQL 9.6. First I create my user in this way: CREATE USER springappuser WITH PASSWORD 'pspringappuser'; The database...
asked by 25.03.2017 / 01:42
3
answers

C #: The name 'database' does not exist in the current context (database is the name of a local sql database type .sdf)

My project has a local sql database to register tool loan vouchers and has many tables. In the form presented in the following image, I intend to develop a routine to support the information in the database following this tutorial . For...
asked by 13.03.2017 / 23:44
2
answers

Query with related tables in SQL and C #

I have this form: This form feeds two tables in the database projects and students , all right up to that point, since records are kept, both new projects, and students by separated. What I do not have very clear is in assigning stud...
asked by 11.03.2017 / 23:23
1
answer

Generate Postgres output in columns

I am trying to make a query in a Postgres database where I want to get results in the form of a table as follows. Variables 1, 2 ... n are the names of the sensors that are known (from the list in the query). Then, the result would be for each d...
asked by 07.03.2017 / 09:29
1
answer

Problem with select to show records

I am developing a fixed asset management system and I have a query that brings me information from different tables, one of the tables called kz_sgaf_distribdebajas (distribution of casualties) keeps records about asset losses that have b...
asked by 23.02.2017 / 06:55