Posts by godoy.alexandre • 317 points
15 posts
-
0
votes0
answers21
viewsQ: GPG error when adding SQL SERVER key
Good morning, I am installing SQL SERVER on Linux Ubuntu 18.04, as per the tutorial https://docs.microsoft.com/pt-br/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-ver15, but when…
-
3
votes1
answer28
viewsA: Creating view in Mysql
What happens is that the database in the course of the execution it does a validation of your code, taking the list of existing attributes in SELECT and searching if it exists in your tables, as the…
-
0
votes1
answer23
viewsA: Query with two summation results from a condition
This would be possible using sub-query for each attribute, for example SELECT ( SELECT SUM(Ocisubtot) FROM Orvendalevel1 WHERE cod_product = 1 ) AS 'Total Produto' ( SELECT SUM(Ocisubtot) FROM…
-
1
votes1
answer31
viewsA: Case & When in Select
A suggestion would be to adapt the data according to the need, generating these attributes within the FROM to be consumed on another level, an example would be like this, SELECT c3.qtde_solicitada,…
mysqlanswered godoy.alexandre 317 -
0
votes1
answer29
viewsA: #1005 - Cannot create table`db_to_do_list`. `tb_completed` (error no. 150 "Foreign key Constraint is incorrectly Formed")
First we need to create the PAI table which in your case would be the table tb_list CREATE TABLE tb_lista( id_conteudo INT NOT NULL PRIMARY KEY AUTO_INCREMENT, conteudo TEXT NOT NULL ); Later the…
-
2
votes2
answers68
viewsA: Sum of a product returning in a column the total
You can, if you do this using sub-query SELECT Q.*, (SELECT SUM(qty_product) FROM quintada_management as SQ where SQ.name_product = Q.name_product) as total FROM quintada_management as Q…
-
0
votes1
answer34
viewsA: List only contracts due by ID and do not consider if ID has contract in force
First problem in your query, within the where there is that ce.cte_id = ce.cte_id , What’s the point of comparing something to itself? There is no logic, maybe the problem is a c the more, getting…
mysqlanswered godoy.alexandre 317 -
0
votes1
answer114
viewsQ: insert the license into SQL Server 2019 Standard Edition (64-bit) on Linux (Ubuntu 18.04.5 LTS)
Good morning Gentlemen(as) I installed SQL Server 2019 Standard Edition (64-bit) on Linux (Ubuntu 18.04.5 LTS) and after I bought the license, however I can’t find a tutorial or something that helps…
-
0
votes0
answers51
viewsQ: Grant select for view
Good morning gentlemen I created a view and later created a user CREATE USER pafunsio IDENTIFIED BY "pafunsio"; assigns Grant to connection GRANT CREATE SESSION TO pafunsio; and assigns Grant to the…
-
0
votes2
answers106
viewsA: How to invert rows and columns in an HTML table populated by the return of a query?
This requirement would be the pivot in your query, one possibility is you change the query that exists and use UNION ALL, being a query for each column that you want to appear in your table, so you…
-
0
votes2
answers260
viewsA: Log-in to mysql only with sudo
In the new versions Mysql and Mariadb it use the plugin unix_socket that uses the user credentials to make the connection to the bank. Do the following test, type the command $sudo mysql or #mysql…
-
-2
votes1
answer45
viewsQ: Error connecting to Debian localhost database
I created a virtual machine and installed Debian. After I installed the Cassandra and checked the status to know that the bank is running. but when executing the command cqlsh in localhost I get the…
-
2
votes1
answer35
viewsA: Show date in different rows but grouped services GROUP BY
Your query is inconsistent, you used the table mensalidade_cliente as a centre, after using a INNER JOIN seeking tuition that have a linked client, so far no problem, the error comes next, you use a…
mysqlanswered godoy.alexandre 317 -
0
votes2
answers79
viewsA: Make two updates at once
insert one at a time, use last insert id for PDO mysql_insert_id for MYSQLI
-
3
votes2
answers217
viewsA: Migrate data from one table column to another table column
insert into TB_NEW (field_new) select field_old from TB_OLD; remembering that the same amount of columns in the Insert has to be equal in the select, and the order also, if you need to refine the…