Questions tagged as 'sql'

1
answer

List based WHERE filter with SQL

Good afternoon! Please, I am doing a Notes Filters filter based on a series of CFOPs with SQL. It works like this: SELECT * FROM NotasFiscais WHERE CFOP = 5101 OR CFOP = 6101 OR CFOP = 5922 OR CFOP = 6922 OR CFOP = 5933 CFOP = 6933 OR .......
asked by 04.02.2015 / 13:14
1
answer

Error statement and executeUpdate SQL - NetBeans

try{ Class.forName(driver); Connection conn = DriverManager.getConnection(str_conn, usuario, senha); Statement stmt = conn.createStatement(); String sqlinsert ="insert into cheque (data_cheque,valor,repasse) values ("+...
asked by 30.01.2015 / 18:30
1
answer

Relating multiple data from one table to one data from another with SQL

I needed to list, with SQL, the father, mother and spouse of a person together with their general data (eg name, address, telephone, email, father, mother, spouse, status). This data is in another table called dependent, each one related to t...
asked by 13.05.2015 / 18:50
2
answers

Search in a field with JSON encoding

There is a field in the table where the content before it is written is encoded in JSON. Content is written as follows: [["nome_completo","Ana Concei\u00e7\u00e3o Dias"],["idade","27 anos"],["cidade","Lisboa"]] In PhpMyAdmin, the select...
asked by 23.01.2015 / 20:26
1
answer

Optimize SQL Query on three tables

I have a product table that has a foreign key that is the category and a table that stores the name of the product photos. I usually make two queries: one to retrieve the category name and some product fields and another to collect an image of t...
asked by 26.12.2014 / 22:49
3
answers

Make an UPDATE with the value of another database

My bank is like this: cd_endereco | ds_endereco 1 | Rua joão e maria 2 | Rua Manuel Silva And in the other database, I have the same columns, entertaining cd_cliente . I want to pass the values from this table...
asked by 02.12.2014 / 14:49
1
answer

How to save a file in a field in SQL Server?

I would like to know how to save a file within a SQL Server com C# field. Reading in some forums I realized that there is a difference between image files and binaries. The type of file I want to save is Outlook e-mail. I'm making a sy...
asked by 02.12.2014 / 18:38
1
answer

Deleting a record in cascading tables

I have a table "Terms" that your ID is FK from "Expression Terms". As shown in the figure below. When I run the command "delete Terms where IDTermo = 4" sql generates me the following error.    The DELETE statement conflicted with th...
asked by 03.12.2014 / 14:18
2
answers

More than one table in the query - LEFT JOIN SQL

SQL Help: Query : SELECT * FROM concursos LEFT JOIN concursos_categorias ON concursos.id = concursos_categorias.idConcurso LEFT JOIN categorias_concursos ON concursos_categorias.idCategoria = categorias_concursos.id WHERE concursos...
asked by 22.10.2014 / 12:50
1
answer

DELETE command in VBA does not work

I have a project that adds and deletes dates, to add I have the following code: Set dbs = CurrentDb dbs.Execute " INSERT INTO TMP " _ & "(diaMes) VALUES( " _ & "'" & tmp7 & "') " where tmp7 is the date in dd-mm-...
asked by 08.10.2014 / 13:41