Questions tagged as 'sql'

1
answer

Check duplicate items and update a column in all but one

I have a table of products that bring information from an XML, and another table in the system that basically receives these products after approval (we have an interface to define what goes in or not, basically changing a value in the product s...
asked by 15.12.2016 / 16:19
1
answer

Filter dates that user entered our system

Hello, how are you guys? I'm trying to filter the dates that users connect to my system. It has a but, first need to filter so it does not have duplicate users. I'm already doing this with the DISTINCT command. With the result that D...
asked by 09.12.2016 / 13:45
2
answers

MySQL error "expects parameter 1 to be resource, boolean given in"

$query = "Select * from servico where ID_SERVICO = $id"; $result = mysql_query($query); if($row = mysql_fetch_array($result)) { $nome = $row['NOME']; if($nome == 'Marketing') { include ("servicos/marketing.php"); }...
asked by 07.08.2014 / 19:13
1
answer

Doubt when changing fields automatically subSelect

I would like to know how I can change all the fields in my sales table. By modifying the field total_coin that will receive the quantity * preco_unitario. Remembering that I have 150 records in my sales table, then I would like to automati...
asked by 03.12.2016 / 02:09
0
answers

Copies a column from a given table to another column of another table

I'm trying to do this update, but I'm having trouble since I'm grateful for the help !! UPDATE pctabpr set pctabpr.ptabela = (SELECT ptabela FROM pcembalagem WHERE p...
asked by 06.12.2016 / 01:02
1
answer

Adding images to bd using classes in C #

I'm doing a project that has classes, for example, a user class, where you have: code, name, password and photo and if you have the method of user input: public string Inserir() { return "insert into Usuario(Username,Senha,Foto...
asked by 16.11.2016 / 22:28
1
answer

Fill bank by expanding a given value in so many items

I have in the bank the registration of the building, with the amount of rooms qtdSala , among others. I'm trying to insert, in another grid, each room according to the value entered in qtdSala , to register in the rooms table, throug...
asked by 01.02.2017 / 04:30
1
answer

Bring a record of each ID with the most recent change date

I'm working with Oracle database and PHP, I need to return only one product each with the most recent change date, the tables are as follows. product price Ihavetriedseveralquerytypes,butIalwaysgetduplicateresults.Andtryingtogroupwiththef...
asked by 22.12.2016 / 13:35
1
answer

Update on a table row

I'm starting to use SQLite in a project and would like some help on how to update on a particular line, in this case, only one ID will be updated at a time. Follow the codes: View and where the update button is clicked: @Overri...
asked by 28.11.2016 / 17:07
0
answers

Select last conversations by counting the unread messages in each conversation

I made a chat in NodeJS and I can already bring the list of conversations. However, I also need to bring the amount of unread messages from each conversation. Currently this query brings the total number of unread messages in all conversation...
asked by 14.10.2016 / 05:27