Questions tagged as 'sql'

1
answer

return only your last move of each code

A table records the movement of items by item code, date and time of movement. Soon the presentation looks like this: CD_Item | DT_Mov 15 10/04/2018 08:52:36 15 21/05/2018 09:32:10 15 20/05/2018 14:24:08 15 10/04...
asked by 22.05.2018 / 16:38
1
answer

Mvc List only available and not occupied rooms

I have the following problem: A reservation has a client and a room associated with it. When creating a reservation, I have to fill in some fields (such as customer name, date of entry, date of departure and the room where you will be staying)....
asked by 22.05.2018 / 17:01
1
answer

How do you use the UPDATE command more than once? [duplicate]

I can not use the UPDATE command more than once. For example, when I perform the update at id 43, that's fine. But when I try to finish 44, it does not finish, but the 43 that gets the update .. Code: Int att,index; Private vo...
asked by 23.05.2018 / 16:03
1
answer

Reset the priority of a record in the table

I need to do an update to reorder records in a table in an Oracle 9 bank. This table stores records that are requests made by users to TI. So, briefly, I have the following fields in the table: PK | NOME DEMANDA | PRIORIDADE ------------------...
asked by 05.04.2018 / 15:35
1
answer

SQLite recursive query

I'm trying to query a SQLite database, I have the following tables: Table suggestions: CREATE TABLE IF NOT EXISTS sugestoes ( id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, texto VARCHAR(250), autor VARCHAR(250...
asked by 29.05.2018 / 04:19
4
answers

Optimization in sql

Considering these two tables in the database: Product Table: | id | nome | |-----|-----------| | aaa | Produto A | | bbb | Produto B | | ccc | Produto C | Attributes Table: | id_produto | atributo | valor | |------------|------...
asked by 21.03.2018 / 20:40
1
answer

Help with MongoDB

I'm having a problem using .find() of mongoDB with RegExp. I have the following command: db.collection.find({"city": /SAOPAULO/}) When I do: db.collection.find({"city": /SAO/}) It searches in time, but when I pass a large word i...
asked by 23.04.2018 / 20:04
2
answers

Select only 1 record per month with an aggravating factor that prevents the use of Group By

I have the following table: Ineedtobringonlytheoldestsaleoftheclient,regardlessofthetypeofsale,howeverIneedthetypeofsaletocomeinselect,beforeIhadasimilarquestionandtheyhelpedmehereinStackOverflow,butraisingthelevelofstudies,Icameupwiththispr...
asked by 08.05.2018 / 15:40
2
answers

How to disable Trigger of all tables in PostgreSQL? [closed]

How to disable the triggering of all my tables in postgreSQL?     
asked by 20.04.2018 / 03:55
1
answer

How to return a table from a POSTGRES function?

Hello, I'm trying to create a function in postgres, which at first is all correct, taking the return from the function. When I run the function, it is returning all rows, but all in only one field as a string. And I need it to come in the tab...
asked by 20.03.2018 / 19:53