Questions tagged as 'sql'

2
answers

How to select all the columns of a row?

Is it possible to select all the columns of a row? I have a function where, on the screen where the user will be created, a validation is made in the first field typed to see if the ID of the user that I am trying to register in the databas...
asked by 30.04.2015 / 02:41
2
answers

Slow response (PHP MYSQL) [closed]

<?php require('DB.class.php'); //$conexao = mysql_connect('xxx.xxx.xxx.xxx','base_dados','utilizador'); //$db = mysql_select_db('base_dados',$conexao); $SQl_list = DB::getConn()->prepare("SELECT * FROM 'wpr3_posts' WHERE post_con...
asked by 02.05.2017 / 17:48
1
answer

Group Mysql Values

Dear, I have a table with the configuration: Tipo Medida Valor 1 0.2 5.00 1 0.4 6.00 1 0.1 5.00 1 0.3 5.00 2 0.1 3.00 2 0.2 3.00 2 0.3 5.00 2 0.4 5.00 I would like to group the values where th...
asked by 02.10.2014 / 21:30
2
answers

Is it possible to use IF within the FROM in MySql?

Could it be IF within FROM ? I searched but could not find anything about it. Here is an example of what I want to do: SELECT usuario.* FROM ( SELECT IF( (SELECT COUNT(*) FROM pessoa) > 0, SELECT FROM pessoa,...
asked by 24.05.2016 / 22:13
1
answer

Subselect within a field

I'm displaying multiple fields through a SELECT: SELECT razaosocial, nomefantasia, cnpj, ie, im, endereco, endereco_numero, endereco_complemento, codCedente FROM cliente WHERE razaosocial LIKE '%carvalho%' . So far, all right. But th...
asked by 14.10.2015 / 17:37
2
answers

Query two tables without foreign key and relationship

I have two tables tb_pedido and tb_pagamento , I put an example below with some dummy data. I need a report that shows the data of tb_pedido and tb_pagamento , all in a single table as in example 3. I thought about doin...
asked by 28.11.2018 / 19:06
1
answer

problem executing select on more than one table in delphi and firebird

select works in firebird, but the -104 error in delphi IBQuery2.SQL.Add('select l.jb_cdempresa, l.jb_cdfilial, p.dtvencimento, l.jb_cdcontacredito, p.vlrpago,'); IBQuery2.SQL.Add('l.jb_cdcontacredito, p.vlrpago, f.cnpj_cpf, f.insc_rg,l...
asked by 14.12.2018 / 18:52
0
answers

C # Check if there is File then [closed]

Good afternoon, I have a code that cleans notepad, writes to another notepad and inserts into the database, but now I need it to check if there is another file with the same name and if it is recent, do the update, but I do not know how I can do...
asked by 04.01.2019 / 18:03
1
answer

SQL group records by time

I have a table in MySQL that stores events by time with the following structure:    id / num_veh / time I would like to create a SQL query that returns the events in groups by time range. For example:    From 01:00 to 06:00 - 500 items...
asked by 16.11.2018 / 03:56
1
answer

Excel generated by PHP query returns with incorrect characters

I made a PHP query to generate an Excel report. Home The values are saved correctly, as shown below: However the generated Excel returns with incorrect characters, mainly in Mandarin, rsrs, as shown below: Ialreadyinsertedtheconversion...
asked by 19.11.2018 / 19:31