Questions tagged as 'sql'

0
answers

create a trigger to allow book borrowing only for students who have 'MT'

The teacher asked me to do a trigger in postgresql, but I can not do it if someone can help me, create a trigger to allow a book loan only for students who have 'MT' status, create function language plpgsql at $$ begin     if     insert business...
asked by 06.12.2018 / 22:16
1
answer

UPDATE update without affecting all rows in table without ID [closed]

I have a table with information from some clients and I needed to give UPDATE however as the table has no ID and most of the data is repeated including cpf is there any way to give the where on the selected line only?     
asked by 20.12.2018 / 16:10
0
answers

Problems with Where

I'm using MariaDB and I have a problem in the WHERE clause of the bank. The query is inside Excel which brings me periods from the bank through the month filter. But I was asked to change for a period of time, but it is bringing me an empty...
asked by 14.12.2018 / 16:01
1
answer

How do I set only one column row in which all values in this column are the same?

I'm trying to set the column ocupado only one line at a time, something like: update suite set ocupado = 'S' where tipo = 'i'; But this statement changes all rows in column ocupado where tipo is i , and that's not...
asked by 24.10.2018 / 17:36
1
answer

Using SQL in coalesce with Date

I have the following question. In SQL your doing so works. ...and coalesce(tb_cadastro.cod_produto,'') = coalesce(:COD_PRODUTO, coalesce(tb_cadastro.cod_produto,'')) and ... Where COD_PRODUTO is an integer, what would I do if the fie...
asked by 18.10.2018 / 13:29
0
answers

You have a syntax error in your SQL next to 'T FOREIGN_KEY_CHECKS = 0' on line 1 [closed]

I do not handle a lot of database, so my knowledge in sql is minimal. A friend gave me a db so I could edit and update the data of this (which seems simple), but when trying to import via phpMyAdmin the following error occurs and therefore I can...
asked by 02.11.2018 / 12:02
1
answer

ACCDB + PHP get name of columns and table

I am uploading accdb files in the database to import clients on my system, in a CRM that I used I could upload this file and automatically already displayed the columns to be able to be linking with CRM information. I was able to read the data f...
asked by 03.11.2018 / 15:55
1
answer

Function to return the months of the year sql server

I'm new to sql server and would like a help with an exercise I'm doing if possible. I have a query that returns me the region of a reseller, the name of the reseller, the cnpj, the date of registration and and the amount of sending sale...
asked by 03.10.2018 / 22:10
1
answer

APP quits unexpectedly on your smartphone

Below is the code and logs. I try to run, but it always closes the app unexpectedly. It closes without showing the error image or inserts into the database. package... imports public class Cadastro extends AppCompatActivity { EditText t...
asked by 03.10.2018 / 22:16
2
answers

How do I update a data when the inserted date is equal to the current date?

I am making a system where the user can schedule postings, that is, if he enters the date and time, the post will be released when the current date is equal to inserted, until there logic is simple but I am in trouble to apply this to a function...
asked by 26.09.2018 / 23:32