Questions tagged as 'sql'

1
answer

Using Inner Join Correctly and Adding Results

In my DB, I have 4 tables: Aluno , Ano , Matérias and Nota . They are mounted as follows: Tabela :: Colunas ---------------------------------------------------------- Aluno :: AlunoID | AlunoNome | AnoID...
asked by 04.09.2016 / 04:02
1
answer

Select accessing two tables

I have a Product table, with the marker, model, and type fields. A second table for laptops has its fields related to price, RAM, other fields, and the model, which is the same as the Product table. How to make a select that tells me the m...
asked by 01.09.2016 / 21:15
1
answer

Ignore date / time field in group by

I have the following query: Select msi.segment1 codigo, msi.description descricao, pcn1.quantidade Qtde_Romaneio, nvl(SUM(pcn2.quantidade),0) Qtde_C...
asked by 13.09.2016 / 14:00
1
answer

Set_base Field NULL Conforming SQL

   Reference issue:       Delete sectors and their descendants - PHP I have the following SQL: CREATE TABLE IF NOT EXISTS 'setores' ( 'set_cod' int(10) NOT NULL AUTO_INCREMENT, 'set_base' int(10) NOT NULL, 'set_setor' varchar(50) NOT...
asked by 12.08.2016 / 02:53
1
answer

Invalid Data Types

I am trying to create a table in my database, however it is giving error of invalid data types Script from my table: create table Venda ( cod_Venda number(5)not null, DataVenda DATE, Hora TIME, cod_Comanda number(5)not null, const...
asked by 17.10.2016 / 00:18
1
answer

Problem with SELECT [duplicate]

I have the following SELECT SELECT t.nome, count(t.id) FROM Partidas p LEFT JOIN Times t ON p.codTimeCasa = t.id OR p.codTimeVisitante = t.id GROUP BY t.nome I would like it to return the teams that have no connection with the p...
asked by 17.10.2016 / 01:59
1
answer

BKP SqlServer is not executed when executed by a trigger (trigger)

I have a procedure that runs a bkp from my database. If I run it through SqlServer the bkp is performed normally But when I call a trigger, another procedure or application bkp is not performed, the folder is created on the server, but the bkp f...
asked by 15.07.2016 / 00:08
1
answer

Update table with data from another table by decreasing character

Hello, I have the BDMCOM1 bank that has a Product Balance table and a Quantity column with values like this: 1,000. However I have another bank BDMCOM1_V3_ALEA that also has the Product Balance table and Quantity column, but with values in this...
asked by 11.07.2016 / 16:08
1
answer

How to convert search result in mysql into columns

Good evening guys, I do not know if anyone has gone through this, but I need to convert the result of a mysql search into columns, not to change the rows through the columns, but to make some results become the titles of column. Being: NOME...
asked by 14.06.2016 / 23:25
1
answer

READ PHP - mysql_fetch_array

Hello, I'd like some help with the command below. I'm trying a read in a database table but I can not do while because it only shows the last record. Note: Using vardump it shows loop normal. <? class AppNoticiasDe...
asked by 14.06.2016 / 05:48