Questions tagged as 'sql'

1
answer

Count rows that have the same value in 2 different columns?

Table ID jogada pontos 1 1 3 1 1 1 2 5 1 2 5 1 2 5 3 2 5 3 I wanted to create a query that counts the play lines and sums the total of points,...
asked by 05.06.2017 / 04:03
2
answers

Masking SQL Select Return

I'm using the following SELECT to return the IDs of a table. SELECT id, duracao_sessao FROM usuario For ID 1 I want the text "Object" to be displayed For ID 2 I want the text "Class" to be displayed For ID 3, I want the text "Struc...
asked by 02.12.2017 / 19:06
1
answer

SQL Select highest value item

I'm using the NorthWind database, and I want to select the category that has the largest number of items entered. I was able to list the category ID and the number of products it has with the following command: SELECT CategoryID, COUNT(Product...
asked by 26.11.2017 / 20:23
1
answer

Odd Row Queries SQL SERVER

I need to create query script that returns from the table only its odd rows, sorted in ascending order: DECLARE @table TABLE (coluna1 varchar(50)) INSERT INTO @table VALUES ('Anthony'),('Miguel'),('Benjamin'),('Lucca'),('Enzo'),('Martim'), ('N...
asked by 23.11.2017 / 16:06
3
answers

How to remove single-variable apostrophes

I have a text edit PRODUCT that looks like this: 'ADHESIVE 478', with apostrophes. How do I make it look like this: 478 ADHESION on sql server? I've tried it that way and it does not work: DECLARE @ProdutoNome VARCHAR(30); SET @ProdutoNome =...
asked by 13.06.2018 / 19:19
1
answer

Character exchange in a position - sql

I want to replace the third character of a string in firebird, example: 00028 by 00128, 00029 by 00129 ... Could someone help me, I tried to see by replace, but I can not determine the position     
asked by 29.05.2018 / 16:07
1
answer

How to do a "for each" in SQLite

I have a table A with n records. For each record in this table, I want to get the information from a x field to make a select and, from the result data of this select , make a insert on a table B. Only that I need to do t...
asked by 12.06.2018 / 20:34
2
answers

Insert imagem.jpg in the database

Good morning! Home I want to insert an image in the database in .jpg format, but when it is inserted it appears like this in the database: ???? JFIF Here is my code related to the image: <form action="" method="POST" enctype="multipart/for...
asked by 08.06.2018 / 11:22
2
answers

Apply between a hql in c #

I'm trying to apply an between with two fields of a part of my form, are dates and ids of vehicles, I'm not very aware of how it models this by HQL in nhibernate with C #, I wanted to know what it would be like to apply this to hql. Normally m...
asked by 19.12.2017 / 16:24
2
answers

PHP errors / warnings parameter 1 & 2 [closed]

In my PHP code the following warnings appear:    Warning: mysqli_query () expects parameter 2 to be string, object given   in on line 8       Warning: mysqli_num_rows () expects parameter 1 to be mysqli_result,   null given in on line 9...
asked by 16.05.2017 / 21:32