Questions tagged as 'sql'

1
answer

Count in IReport

I have a report where I have the Status column, in this column I have the following statuses: Finished and Pending. I created a variable and added it to the Sumary band and set the following properties: Variable class = java.l...
asked by 06.08.2015 / 15:52
2
answers

SQL Server - Doubt update and relationship between tables

I have two tables, one call coletor , and another call material , I have a proc called cadMat , which was to register material in the database and by cpf (parameter of proc) put as name of collector the materials that it...
asked by 21.05.2015 / 13:18
1
answer

How to avoid duplication of content in a table without a primary key?

In a virtual store panel that I am building the products have relationships by color and size, where each product color has a size. This is a part of my database for a better understanding of the problem: link When the user wants to associate...
asked by 20.05.2015 / 16:44
1
answer

SQL return on different columns, not on rows

I am testing a query, where I would need the returns to come in distinct columns, but in the form below it returns in rows. I tried to use LEFT JOIN but the syntax did not work. select u.nome_completo AS NOME1 from usuarios u where u.cr...
asked by 27.04.2016 / 15:11
1
answer

Is there any risk in using "SET FOREIGN_KEY_CHECKS = 0"?

According to what I read somewhere, FOREIGN_KEY_CHECKS :    ... Specifies whether or not to check foreign key constraints for InnoDB tables. That is, if the guy wants to disable the foreign keys check, it does: SET FOREIGN_KEY_CHE...
asked by 17.11.2017 / 16:05
1
answer

Telephone Directory Search

I have a search problem with phrases, I have a search field and I am using the LIKE operator to do this, but it is not serving me correctly, I have tried to use SOUNDEX now, but it only returns one word with the same phonetic than the other word...
asked by 09.01.2015 / 17:53
2
answers

Query in two tables at the same time

I have, for example, the following scenario:                           Table                                Column01                                Column02                                Column03              Home                        ...
asked by 18.02.2016 / 23:09
1
answer

Select that compare sets of column values from two tables

Sirs, First, I have 2 tables Table 1: ID L1 L2 L3 L4 L5 ------------------------------------ 1 a c e g i 2 a c d g i 3 l n p r t Table 2: ID L...
asked by 27.09.2016 / 21:50
1
answer

Field SUM of two Subqueries in MSSQL

I'm needing a field derived from two subqueries that gives the sum of values based on a field. Here's an example: SQL: SELECT CodCliente ,DataVenda ,Vendedor ,Valor ,DataPagamento ,TotalCliente --> SOMA DE [Valor]...
asked by 09.02.2015 / 12:54
1
answer

Recursive Query

I need to set up a recursive query to solve a simple problem, but I'm having a bit of trouble. I have a table named TABELA1 with the following fields (ID, IDPAI, NAME) I'll put some examples of records here and what I need. Recor...
asked by 24.02.2015 / 14:31