Questions tagged as 'sql'

2
answers

Insert multiple rows in Informix

I use an Informix database and I have to do 3500 inserts. Informix runs line by line and this is impractical. How do I insert all the rows at once? Example: insert into tabela (coluna1, coluna2, coluna3) values (valor1, valor2, valor3) insert...
asked by 05.04.2018 / 17:12
1
answer

SQL - Search for the names of the patients who had more appointments in the month of January 2016

Hello, I would like to know how to do this query: "Search for the names of the patients who had more consultations in January 2016." select * from PACIENTES select * from CONSULTAS These are the photos from my table     
asked by 19.11.2017 / 16:34
2
answers

Divide a query

I need your help, I have a query in my system, which has 4 cases SELECT TOP 3 * FROM ( SELECT Title, SUM(Count) AS Count FROM ( SELECT CASE WHEN EstadoId = EstadoIdAutor AND EstadoId = Meddoc1 AND Estado...
asked by 03.10.2017 / 14:07
1
answer

Foreach with 2 conditions

I'm trying to put two conditions in the foreach, but I'm not having success. The idea is as follows: the client accesses the website at the following URL: / room / balcony and only products that have in their database in the DB the room environm...
asked by 29.10.2017 / 00:54
2
answers

What are real and practical examples of using Stored Procedures?

While attending an interview for the developer position, I come across a question related to Stored Procedure SP ) and at first I have theoretical knowledge on the subject, but I have never come across a practical example in the use of SP and...
asked by 04.12.2017 / 19:31
2
answers

How to make a query that just counts an unbroken stream?

I want to count uninterrupted values of the current year back until the first NULL occurs. Example:    Several people make donations to an NGO annually and this is   stored in a database, I would like to know how many years a   pers...
asked by 30.11.2017 / 13:34
1
answer

Relationship 1: N check date, difference 6 month

I'm developing a SQL Server procedure, which lists two tables: WhereaprocesshasN-statements,Ineedtoreturnthefollowingdata:allProcessNumbersthatarewiththeIrrecuperavel(int)=1columnandthe"last" date entered in the Process table for that% Proce...
asked by 28.11.2017 / 17:10
1
answer

Error Code: 1054. Unkowm column

I want to query a value from an account I made in SQL: (Valor - (select Visibilidade)) AS Diferenca When I try to query: Diferenca <= 500 It displays the following error: Error Code: 1054. Unknown 'Diferenca' in 'w...
asked by 19.09.2017 / 20:37
2
answers

Search in two tables [duplicate]

I have a media table with the fields id_midia , nome , tipo , and another synonymous table that has the id_midia , sinônimo I need to make a query where it checks the two tables whether the term you typed is co...
asked by 20.09.2017 / 14:23
1
answer

Changing a data type across the schema in oracle

Good afternoon! I need to change a data type of my entire schema, I have varchar2 80, and I would like to change it to 100, but this all at once ... is it possible?     
asked by 07.09.2017 / 22:06