Questions tagged as 'sql'

0
answers

Optimize SQL code

I would like to know if a way I can optimize this sql (mysql) code I did, the search is very slow, taking too long to bring the selected fields, I've already done some testing but it's still the same. > SELECT rc470.cod_item as 'Código do Prod...
asked by 08.06.2015 / 22:55
5
answers

CodeIgniter - Message: Trying to get property of non-object

I'm trying to solve this error:    Severity: Notice   Message: Trying to get property of non-object   Filename: contracts / visual.php   Line Number: 37 CODE: contract_model.php public function getById($id){ $this->db-&...
asked by 08.06.2015 / 21:48
3
answers

Javascript and SQL - Fill a ticket with one line data after selecting it

In a site, I have the following function in Javascript to bring me into a table the result of a query SQL . function buscaBoletos(){ $.ajax({ async: false, cache: false, url: '[:raiz]emissaoBoletos/getBoletos', data: (...
asked by 09.06.2015 / 19:07
1
answer

Associate values of a dropdown with a specific column in the DB for query

I have a filter on my site that is in the image below: Therealpurposeofthisisto"search" travel destinations (eg Paris, Barcelona, Bahia etc ...) and display the same. I have the following table structure represented by bean's below (with...
asked by 10.06.2015 / 02:48
1
answer

List calls with or without id

Gentlemen. I have the following function. $sql = " SELECT c.*, cli.*, cli.razaosocial as nomeCliente, c.idCliente as idClienteChamada FROM...
asked by 12.06.2015 / 04:31
0
answers

Return columns according to sql server criteria?

How can I return the column names of a table according to search criteria? I want to return the columns that are with 'S' option, all fields is a char of 1 that receives 's' or 'n' select b.livros, b.jogos, b.cinema from tb_cadast...
asked by 12.05.2015 / 05:14
1
answer

Error copying data from one table to another

Good afternoon, I'm doing an application that does a dvs loan request, I was able to make the application to insert the reservation, now I need to make the owner of the dvd confirm the rent and copy the data in the table of rented dvd but I have...
asked by 05.06.2015 / 17:56
0
answers

Returning empty table

create function teste( teste varchar ) returns setof record AS $$ begin execute teste; return ; end; $$ language plpgsql; select teste ('select * from public.opcional '); Is this returning me a record with nothing like how do I disp...
asked by 07.05.2015 / 22:10
3
answers

Subquery with SQL

I'm trying to solve an exercise in khanacademy in the SQL course and I'm having some difficulty. The exercise asks for the following:    To finish creating the playlist "Pop", add another search that will select the title, title, of all th...
asked by 18.06.2015 / 04:40
0
answers

Query from selection in comboboxes

I have 4 comboboxes populated with data from a database, using js. The user selects options in these 4 boxes and, from there, I want to make a query with the options chosen. How can I get these options and save them in variables to use in my que...
asked by 18.04.2015 / 02:09