Questions tagged as 'sql'

1
answer

Get an image of the body of an email, write to the database or in memory and show it in a new Viewer

I'm trying to build an E-mail viewer. To do this, I access my IMAP server and get mail, using the ComponentSoft.Net.Mail DLL. After getting the message, I want to display it in my viewer. However, I'm having problems with the Linked re...
asked by 29.01.2014 / 18:35
2
answers

How to remove a foreign key in mysql?

I need to edit a table, but I can not remove it. I need to remove the foreign key, but all the commands I tried did not work. I'm currently tempting the alter table tabela drop foreign key nomefk And the error always happens saying that...
asked by 14.02.2018 / 19:22
3
answers

How to query in MySQL with two different conditions in WHERE

I have two queries that work perfectly apart, but I needed all of their records together. They would be these: SELECT b.idBanca AS idB, b.DataHora AS dataHora, b.Sala AS sala, t.idTrabalho AS idT, p.Nome AS orientador, a.Nom...
asked by 09.12.2014 / 04:11
5
answers

How to create a view in mysql by taking data from 3 tables and repeating the different columns in the result?

I have the tables: +----------Tabela-1--------+ id | nome | cnpj | qtd1 1 | carlos | 0563233 | 4 +--------------------------+ +----------Tabela-2--------+ id | nome | cnpj | qtd2 1 | carlos | 0563233 | 6 +-------------------...
asked by 18.06.2014 / 14:20
4
answers

Constructing SQL tables - using or not fields with Not Null?

I am having a question regarding the construction of tables and the use of Not Null field. I know that for fields of Primary Key , it must be Not Null , but in other fields, what is the need to use Not Null ? so I und...
asked by 11.08.2016 / 13:26
5
answers

How to check if a text or ntext field is null or empty?

How can I check if a field of type ntext is null or empty in where ? I have the following select SELECT Subject, Notes from DocumentNotes where Notes is null or Notes = ' ' but when compared it returns the following error...
asked by 19.11.2015 / 15:08
3
answers

How to group SQL results by month and year?

I would like to know how I can query the MySql database and group the records by year and month. At the moment I first make a query to get the year records, then for each year I use a for () to filter the results per month within that year....
asked by 09.11.2016 / 20:36
1
answer

INNER JOIN with 3 tables

I have 3 tables TB_ContratoCotista: TB_Contract: TB_Cotist: I would like to relate the values of the TB_Contract table with TB_Cotist but the way I got it just returns the result of the TB_Contract . What am I missin...
asked by 03.07.2015 / 19:25
4
answers

How to display 2 columns of 2 different tables in MySQL?

I have 2 tables with several columns. I would like you to display individual columns from more than one table at a time: tabela1 | tabela2 Nome | Apelido     
asked by 10.07.2015 / 19:35
2
answers

Sql - Delete records in bulk - Delete in bulk

I have a table with about 4 million records. What is the best method to delete all of them to get the best time? Does Indexing help anything, since it is just a reference for finding data? OBS 'DELETE FROM tb_name;' // Demorou em torno d...
asked by 09.10.2015 / 15:39