Questions tagged as 'sql'

1
answer

Retrieve information about which Tables / Procedures / Views are most accessed in SQL SERVER

select db_name(database_id) as banco, object_name(object_id) as objeto, stats.user_seeks, stats.user_scans, stats.user_lookups, stats.user_updates from sys.dm_db_index_usage_stats as stats I have this SELECT whi...
asked by 13.01.2015 / 13:58
4
answers

The WHERE clause order interferes with performance?

Recently I did tests on a database with a query using two clauses where AND. I noticed that there was a significant difference using clause A before B and vice versa. Intuitively, it would be faster to use FIRST the more restrictive criterion...
asked by 22.12.2014 / 19:01
3
answers

How to export records in SQL without duplicates?

I'm trying to remove some duplicate records from a table and I searched the Internet how to do this, and found something about distinct . My scenario is: I have a table that has a record with all duplicate columns. ID | Nome | I...
asked by 19.11.2014 / 19:28
1
answer

Problem with LEFT JOIN using Pentaho Kettle

There is behavior regarding JOIN that I can not understand. I have two tables in these formats Sick Table ID_Doente Doente 1 Pedro 2 Paulo 3 Rui Query table ID_Consulta ID_Doente Tipo 1...
asked by 17.03.2014 / 16:44
1
answer

Isolated Storage or SQL Server Compact

I'm making Windows Phone 8.1 something similar to a dictionary where there will be a lot of text with sorting, searching, sorting by name. Keeping in mind that there will be this large amount of information, what would be best to use Isolated...
asked by 28.08.2014 / 00:18
1
answer

Select for days of the month returning 0 when there is no record of that day

I have a database of company calls, for example let's say that the table has only: -- TABELA CHAMADO -- id (id do chamado) inicio (data de inicio do chamado) id_criador (id do usuário que abriu o chamado) -------------------------------------...
asked by 05.09.2018 / 17:03
1
answer

How to insert records through cursor?

I need to insert unique records by a field that has the unique identifier, with this I am using cursor; however, the unique identifier will not add according to the inserts. ERROR: You are duplicating and inserting only the first record....
asked by 28.12.2018 / 12:11
1
answer

Condition in Select - SQL

I have a table where the priorities of output of the supplies per customer are stored, for example: cliente | codigosuprimento | prioridade | quantidaestoque 1 | 500 | 1 | 20 1 | 501 |...
asked by 04.10.2017 / 22:36
2
answers

Return the highest value between columns and the ID for the line of this higher value

Let's say I have two columns in my table, column A and B. +-----+-----+-----+ | ID | A | B | +-----+-----+-----+ | 1 | 500 | 681 | +-----+-----+-----+ | 2 | 980 | 101 | +-----+-----+-----+ | 3 | 110 | 981 | +-----+-----+-----+ If...
asked by 12.11.2018 / 22:28
1
answer

What is the difference between INNER JOIN and INTERSECT?

What is the difference between INNER JOIN and INTERSECT? Can anyone exemplify it too?     
asked by 01.12.2017 / 14:41