Questions tagged as 'sql'

1
answer

Select TD javascript

I'm developing a routine with a pivot table using javascript, where when I open the routine a button 'ADD TABLE' appears Whentheuserclicks'ADDTABLE'thetableheaderappearsandan'ADD'buttonthatisresponsibleforaddingrowstothetable. Theproblemisth...
asked by 13.11.2018 / 13:06
1
answer

Insert MySQL Database

I need to insert into the MySQL Database (table fotos ) the path that is set to $target_file_name . I believe that the error is probably at the time of INSERT . File conexao.php :      try { $PDO = new PDO($dsn,...
asked by 11.11.2018 / 21:38
2
answers

registering php data in database SQL server 2008

I have a question ... I do not know if I'm putting the code correctly, I'm a beginner in php and I need a help ... I already managed to do the form that I have to write to MySql ... but now I'm messing around in a SQL Server and I can not get it...
asked by 29.07.2014 / 00:35
1
answer

JPQL JPA - Create a grouped list by date with the sum and profit of all items sold that day

The SQL query below is returning a wrong result for the Delay value field. SELECT DATE(p.dt_pedido) AS barChartLabels, COUNT( DISTINCT p.id) AS qtdPedido, SUM((item.quantidade * item.preco) * p.taxa_compra) AS percentualCompra, SUM(item.quant...
asked by 03.11.2018 / 23:24
1
answer

Get the sql that triggers a trigger before update

I have a very simple trigger before update, I would like to get the sql that triggers that trigger. CREATE OR REPLACE TRIGGER atualiza_subelemento BEFORE UPDATE ON tb_material FOR EACH ROW BEGIN IF :OLD.CD_SUBELEMENTO IS NOT NULL THEN DBMS_OUT...
asked by 07.11.2018 / 14:51
2
answers

Bring records from today's date up to 1 month ago SQLSERVER

How do I get records for today's date up to 1 month ago in SQLSERVER? I know that for example, with 7 days, I use GETDATE () - 7. But for 1 month, what would it look like?     
asked by 07.11.2018 / 14:21
1
answer

Error when using ALIAS in select

In the select below, I would like to use the novonome alias in the second column (instr). select substr(titulo, 1, 20) AS **novonome**, instr(**novonome**, ' ')+1 from conteudo; But I get the error:    ORA-00904: "newname...
asked by 22.11.2018 / 18:03
1
answer

PHP + FIREBIRD - Bring result of table relationships

In IBExpert the query below brings the data correctly, but when I use the same query in PHP it does not work. SELECT FUNCIONARIOS.nome, CNPJ, cod_funcionario, LOGRADOURO,...
asked by 26.12.2018 / 14:20
3
answers

compare sql tables displaying different result

I have a sql query that lists two tables: Register and release. I have an application that adds the "id" of "register" in the "release" table, I want to display only the results that do NOT exist in the "unpin" table. follow the query:...
asked by 26.10.2018 / 17:31
1
answer

Select from column B if the field selected in column A is null

In a SQL query I was trying to work out a way to select a value from another B column if the selected A column is null . At first I made the following query: SELECT COALESCE(NULLIF(max(convert(smalldatetime,DEP.DATAENTRADA,100)),null), DE...
asked by 25.10.2018 / 20:01