Questions tagged as 'sql'

1
answer

Error in update sql: Subquery returned more than 1 value. This is not permitted when the subquery follows

I am doing a query to change the net cost of a product according to a brand, but I get the following error message:    Subquery returned more than 1 value. This is not permitted when the   subquery follows =,! =, & lt ;, < =, & gt ;, >...
asked by 10.01.2018 / 12:56
0
answers

Normalize table for 2FN

I have a super bad table in hand and I need to normalize this to 2FN. Can someone give me some tips? I am not able to apply the theory in this table. Here is a sample of it: (the attribute "city" repeats itself although this sample does not repe...
asked by 20.01.2018 / 14:32
1
answer

Split Error by Zero - SQL Query

I have the following query below, however, when I run it, the following message occurs: erro de divisão por zero . I tried to use the nullif function, but to no avail. How to solve? SELECT count(f.SolID) / cast(dbo.horas_uteis_tra...
asked by 05.12.2017 / 17:49
1
answer

Why does MOD (11.2,2) give 1,2 and not 0?

I need to get the rest of a division in ORACLE and I'm using MOD that works fine with integers but when using decimal numbers gives problem. Ex: MOD (11,2) = 1 ok MOD (11.2,2) = 1.2 Wrong right in my understanding would be 0 because 11.2 / 2 = 5...
asked by 05.12.2017 / 18:07
1
answer

How to add a 0 to the left in a datetime

I need to be able to add a 0 left at the time that sql only takes 3 digits ie from midnight to 9 in the morning for the information to be sorted! Because if not the information I have is in the following order 0:00 1:00 10:00 am 11:00 a.m. 19...
asked by 06.12.2017 / 17:40
0
answers

Join two df using the sqldf

I'm trying to join two tables using the same id of the species, but I'm not getting it. Here are the steps below: Importing the corrected file into TNRS for R hp<-fread('tnrs_final.txt', header=T) Now linking the tables using the u...
asked by 06.12.2017 / 23:56
1
answer

Update an attribute according to two other tables

Company Table CREATE TABLE empresa ( cnpj char(18) PRIMARY KEY, nome varchar(60) NOT NULL UNIQUE, receita float NOT NULL, pais_sede varchar(26) NOT NULL ); Target table CREATE TABLE destino( cidade...
asked by 30.11.2017 / 01:33
0
answers

I am having trouble inserting data into a table with php

My form looks like this: <form name="pedidooo" action="cadastrandoPedido.php" method="post" > <?php include './conex.php'; $query = ("SELECT * FROM conta"); $result = $mysqli->query($query); echo '<gg>Nu...
asked by 25.11.2017 / 11:51
1
answer

Problem setting Foreign key

I am now learning database. I do not understand why I'm not letting you set team_id as a foreign key.     
asked by 25.11.2017 / 19:25
0
answers

Help with sql and android studio search

I made this layout <ScrollView xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" android:fillVi...
asked by 14.11.2017 / 17:34