Questions tagged as 'sql'

3
answers

Field value related to another field in another table?

In MS Access I have two tables: tbCourses and tbPeople tbPeople contain: ID , Nome , CursoID , CursoNome ; tbCourses contains: ID , Nome ; Is it possible to make the field CursoNome of the tabl...
asked by 28.10.2015 / 02:53
1
answer

Problems inserting a datatime record

This is the description of my table in MySQL That'showI'mcrackingthelogsinsertintopedido(data_criacao,data_entrega,entrega_cep,entrega_cidade,entrega_logradouro,entrega_numero,entrega_uf,forma_pagamento,status,valor_desconto,valor_frete,valor...
asked by 31.05.2015 / 17:38
2
answers

Get last record of each id in sql query with condition

I'm having trouble getting the last record of every id in a SQL Server table. select c.Serial,v.Descricao,v.Placa,v.Cor,v.AnoFabricacao,v.Chassi c.DataHora,c.Endereco from [CheckPoint] c inner join Equipamento e on e.Serial= c.Serial in...
asked by 26.05.2015 / 21:29
2
answers

fetch_array does not return data

I am making a list of users and the data does not appear on the page. I waited for the user's name, his type, and the number of posts and replies he sent to the system to appear. There is another problem. Three users are registered, but only one...
asked by 25.05.2015 / 19:29
3
answers

Select union between tables

I have two tables, CLIENTS and SALES. I would like to know which clients have no sales, and I store the customer ID in the sales table. I tried this but to no avail: SELECT * FROM cliente RIGHT JOIN vendas ON (vendas.id_cliente = cliente.id...
asked by 23.04.2015 / 20:42
2
answers

TSQL dynamic for multiple returns

I need to make multiple inserts that will depend on an existing result in a table like this: --CRIA TABELA #CONTATO CREATE TABLE #CONTATO( NOME VARCHAR(100) NULL, TELEFONE VARCHAR(50) NULL ); --INSERE 2 LINHAS NELA INSERT INTO #CONTATO...
asked by 22.04.2015 / 22:29
3
answers

SQL largest date of a record before the given date

Next has the following case: Tb_importacao [cod_titulo,data,imp_situacao] cod_titulo data_imp situacao 1 2015-04-10 1 1 2015-04-11 2 1 2015-04-11 1 1 2015-04-13 2 1 20...
asked by 16.04.2015 / 19:26
1
answer

explode () directly in MySQL [duplicate]

I have a column named relacionados in the produtos table and there are some ID's of some items in the produtos table. I needed to make a explode () or something of the type in the produtos table and select all pro...
asked by 01.12.2015 / 17:21
1
answer

Querying using linq to sql in ASP.NET MVC

I have a question about how to return the records according to the query. I do not know what might be wrong, but the query is not returning according to what was passed. I have my controller: public ActionResult Index() { //retornar tod...
asked by 05.04.2015 / 15:27
1
answer

SQL syntax error

I come again with a similar error in the syntax of my SQL. I've tried a few times and so far nothing. If you can give me some help, thank you. Here is my code: $sql="INSERT INTO processos ( processo, numero_beneficio,...
asked by 10.03.2015 / 19:04