Questions tagged as 'sql'

2
answers

Discovering the binary value in SQL Server

Is there a function in SQL Server that converts an integer to binary? Example: SELECT Funcao_Binario(2) -> Saida : 0010 SELECT Funcao_Binario(4) -> Saída : 0100 SELECT Funcao_Binario(5) -> Saída : 0101     
asked by 20.10.2016 / 19:58
2
answers

How to show data of the most recent date? [duplicate]

I have a table1: Auto_Increment ID; varchar name; data date; I would like to see only the data with the most recent date. How do I?     
asked by 05.09.2016 / 11:31
3
answers

PostgreSQL database query

I'm trying to query Postgre with the following query: SELECT t3.desc_serv, t3.nm_serv, t1.nm_usu, count(t2.id_atend) TOTAL_ATENDIMENTO FROM usuarios t1 INNER JOIN historico_atendimentos t2 ON t1.id_usu = t2.id_usu INNER JO...
asked by 05.05.2014 / 17:11
1
answer

How to return only unmatched records in a JOIN? [duplicate]

I have a question regarding the use of JOIN in SQL in this case: I have a produtos table and a destaques table that contains the id of the product. I need to make a query that returns only the records that are n...
asked by 17.10.2016 / 00:50
1
answer

What real difference between the '=' and LIKE?

By doing another test (rs) on a database that I have in MySQL, I realized that: SELECT * From client WHERE uuid = '1kvsg4oracxq' returned the same result as: SELECT * From client WHERE uuid LIKE '1kvsg4oracxq' What exactly is the diffe...
asked by 12.06.2017 / 18:15
3
answers

Field referring to MAX

I have the following table / fields: Table: PLANS ID (PK) VEICULO (REPEAT) DATAINCLUSAO REVISAO (UNIQUE) I need to get the number of REVISAO of each VEICULO of last DATAINCLUSAO...
asked by 04.10.2018 / 16:10
2
answers

Consultation and simultaneous change

Considering a table similar to this: Tabela : [Frutas] ╔════════╦═════════╦═════════╗ ║ Fruta ║ Cor ║ Mordida ║ ╠════════╬═════════╬═════════╣ ║ Maçã ║ Verde ║ Não ║ ╠════════╬═════════╬═════════╣ ║ Banana ║ Amarela ║ Não ║ ╠═...
asked by 16.04.2018 / 18:06
2
answers

Sql Server Error 8623: The query processor ran out of internal resources and could not produce a query plan

Bank Sql Server 2012 and 2008. I have been logged into the following error (sql server 2012): error_reported 2017-12-27 09:14:16.2053050 8623 16 1 False The query processor ran out of internal resources and could not produce a quer...
asked by 28.12.2017 / 21:25
2
answers

How many images can I save in a blob mysql field?

Can I record multiple images in one field blob ? Or do I have to create multiple fields? Imagem1 , Imagem2 etc ...? I wanted to know if there is any way to do this without having to create multiple fields.     
asked by 04.08.2014 / 15:37
2
answers

SQL using sum

I have the following structure: | Data |Quantidade|QTCxVer|QTCxBra| |04.09.18| 10 | 1 | | |04.09.18| 30 | | 3 | |04.09.18| 40 | | 4 | |04.09.18| 50 | 5 | | |05.09.18| 20 |...
asked by 11.09.2018 / 18:50