Questions tagged as 'sql'

1
answer

Error trying to add time field (varchar) sql server

I have a query that returns the following data: SELECT * FROM METAS mes lj saldo meta 4 2 153:59 123:00:00 4 2 25:33 00:00:00 4 2 29:57 08:00...
asked by 08.05.2018 / 01:04
1
answer

How to use foreign key to create a record in another table

I have two tables users and users_info , I would like to use foreign key, so when I create a record in the users table, create a record with the empty fields in the users_info table, only with the id_user complet...
asked by 04.09.2017 / 14:26
2
answers

How to extract in a string the date-time of a given XML field - SQL Server 2012 Query

Good afternoon! Personal, in my table log has a field called logdescricao and in this field it stores several expressions. For example: <log expressao="7085"><par traduzir="N">André Mariano da Silva</par><par traduzir="...
asked by 05.09.2017 / 19:38
4
answers

Create a SELECT to bring the difference of two tables

You have the bisemanas table that stores 26 fixed bi-weeks and the outdoor_bisemanas table that stores the billboards reserves according to the selected bi-week. Edit : What I want is a select that displays all bi week...
asked by 24.08.2017 / 20:49
1
answer

Query - Comparison of distinct bases with equal columns

How would a query make the selection between two tables according to the value of a specific column? For example: I have two tables that contain account number and Balance, I need to know which accounts are not with the same balance. Tab1...
asked by 30.04.2018 / 21:08
1
answer

How to insert into the table if the record does not exist [duplicate]

How to insert into the table if the record does not exist, for example the table_materia_materia, has the following information: +----+-------+---------+ | ID | turma | materia | +----+-------+---------+ | 1 | 1 | 1 | | 2 | 1...
asked by 15.05.2018 / 22:47
1
answer

CASE with IN does not work

I want to do this search below: DECLARE @codccu VARCHAR(10); SET @CodCcu = '63' SELECT E.codepi, E.numcad, Max(E.datent) AS ENTREGA, Max(E.datent) + P.diaval AS VALIDADE, CA...
asked by 01.06.2017 / 14:56
1
answer

Database Query on Android

I'd like some help from you to check out what's wrong with this query: int raioKm = 10; String latitude = "CONVERT(" + "NUMERIC(10,7)...
asked by 16.06.2017 / 01:12
1
answer

Repetitions and combinations of values

I have a table (quina) with 5 fields, each field can have the value of 1 to 80. I would like to know if it is possible in SQL or only in Delphi, to get the dukes (combinations of 2 numbers) between 1 and 80 in the fields from c1 to c5. no mat...
asked by 02.10.2017 / 21:24
1
answer

Select with PDO and SQL barring HTML

I'm trying to make a Select with PDO and MYSQL, but when I put the php code doing this query in the middle of my html it does not allow the execution of the rest of the page. follow the code snippet: <select class="emselect"> &l...
asked by 19.10.2017 / 15:16