Questions tagged as 'sql'

1
answer

Difference Between Using "FROM Table, Table2" X "Join Table ON Table2"

Considering the two forms of joining tables with a join (any): SELECT Tabela.A, Tabela.B, Tabela2.C FROM Tabela LEFT JOIN Tabela2 ON Tabela.Id = Tabela2.TabelaId And a union using from SELECT Tabela.A, Tabela.B, Tabela2.C...
asked by 06.04.2017 / 14:47
1
answer

Query to join one column from another

I have tried unsuccessfully to get a result. I have the table with the following Login and Logout information: |Group |User |EventDate |Event |Camp ------------------------ |Evolution |1012 |2014-07-07 10...
asked by 08.07.2014 / 17:40
2
answers

Table to record record history (Best form)?

I have a question about how best to create a table so that every action in a record is saved, thus creating a history of it. I have the following table, but I do not know if it is the best one. create table sispro_historico_processo ( id_h...
asked by 19.05.2015 / 17:57
1
answer

Is it possible to create a trigger that invokes a web service?

I'm working on the integration of two databases. It is a system that needs the status of employees in HR. For performance issues, I can not point all the employee-dependent queries to the HR base, what I did was create a functionality to i...
asked by 20.01.2014 / 13:05
1
answer

SQL Query Count

I need to make a query where the result is the medals (gold, silver, bronze and total (sum of 3)) obtained by each country in all editions of the Olympic Games. So far so good, the query below already does this. The problem is that the medals...
asked by 20.05.2014 / 00:40
1
answer

Installing SQL Server on the client

I developed a C # application that uses SQL Server Express 2012. In development everything went well with database access because everything is on the same machine (I use localhost ). Now I have to install the application on other compu...
asked by 09.06.2014 / 12:33
1
answer

How to use prepared statements with external variables in MySQLi

I have the following code, in which I want to use prepared statments : prepare.php : <?php include "../conex.php"; // conecta mysqli_set_charset($mysqli,"utf8"); // Transforma em UTF8 pra gravar acentos no servidor // Inser...
asked by 24.09.2015 / 00:46
1
answer

Define default value for database column in Laravel 4

How can I add a default value for a column of my MySQL table through Laravel 4? In SQL would be: create table tabelaTeste( id int NOT NULL AUTO_INCREMENT, coluna1 varchar(50) DEFAULT valor, PRIMARY KEY(id)); In Laravel I am c...
asked by 23.11.2015 / 11:22
4
answers

SQL query to retrieve all records from last month but up to the current day

Good morning, I need to know a% change from last month's job records to job records made this month. For this I need to compare with the current day, for example. If today was 10/15/2015 I need to count how many tasks were opened between 0...
asked by 30.10.2015 / 12:28
1
answer

Why the OFF SET leaves SQL slower?

I have the following SQL, generated by Entity Framework 6. SELECT [Project1].[C1] AS [C1], [Project1].[ID] AS [ID], [Project1].[CAMPO1] AS [CAMPO1], [Project1].[CAMPO2] AS [CAMPO2], [Project1].[CAMPO3] AS [CAMPO3],...
asked by 17.11.2015 / 13:44