Questions tagged as 'sql'

2
answers

How to model n-to-n relation correctly? Women also have friendship with men and not only men have friendship with women

Hello, I want to do the following: Create in MySQL the n-to-n relationship where men have friendships with women and women also have friendships with men. Example: Joao has friendship with Fernanda , but Fernanda strong> but with C...
asked by 08.10.2017 / 19:16
1
answer

Join the result of two Select's commands - PostgreSQL

My need is to join the result of two select's commands so that I get everything returned at once, for example in this command: SELECT codigosuprimento, suprimento, count (codigosuprimento) quantidade, estoqueminimo, count (codigosuprimento) -...
asked by 13.10.2017 / 19:36
1
answer

How to print the selected database ID? [closed]

Is there a function to get information from a specific ID of my database and print with domf? My code: $id = "30"; $result_usuario = "SELECT * FROM cadastro WHERE id = '$id' LIMIT 1"; $resultado_usuario = mysqli_query($conn, $result_usuario...
asked by 03.11.2017 / 15:39
2
answers

How to recover the last payment? [duplicate]

I have the following table in my bank: "financeiro financeiro_id INT AUTO_INCREMENT, financeiro_pagamento DATE, financeiro_pid INT, financeiro_valor INT, "; In this table I record the payments that my system receives, then...
asked by 02.11.2017 / 18:03
1
answer

MSSQL 2012 login transaction log

I need a help, I have to make a login in the MSSQL the company of the ERP and my superior needs to monitor the transactions of type INSERT , DELETE and UPDATE that are made by them, in case the scripts that were run on...
asked by 17.08.2017 / 18:32
1
answer

How to delete rows from a datagridview

I'm developing a C # program and would like to know how I can block / delete a sql row in datagridview . The line I wanted to delete / block is the last one that is selected in print, I wanted to know if it is possible to block or delete b...
asked by 21.08.2017 / 13:15
1
answer

split 1 column into 2 on sql server giving update

I use SQL Server 2012 I have the following problem, in a table there are records of municipalities and two respective UFs, however the need arises to divide this column into two municipalities and one UF, but the data is like this: CANDÓI-P...
asked by 12.07.2017 / 22:07
1
answer

How to ungroup transactions or group by day? [closed]

SELECT COUNT(*) QTD_TRANSACOES, CD_RSP_RECUSA, SUM(VL_AUTORIZADO) VALOR_SOMATORIO, CASE WHEN MR.DS_MOTIVO_RECUSA IS NULL THEN 'CÓDIGO DE RECUSA NÃO CADASTRADO' WHEN MR.DS_MOTI...
asked by 03.07.2017 / 15:22
1
answer

Copy of Oracle Material Structure

We have the following material registration structure: Table Pk FK Filial Descricao material Group Cod_grupo 1 - 1 Materiais de escritório 2 -...
asked by 23.05.2017 / 18:50
1
answer

Assign a variable to a Dynamic Data?

My goal is to create a procedure in SQL Server , which has by default two variables, one with the start date of (hoje - 3 anos) and another as the end date equal to hoje . I already use for other operations (for example a between)...
asked by 23.05.2017 / 20:22