Questions tagged as 'sql'

4
answers

SQL Query Joining 5 tables

I need help to make a query (multiple relationships) in my WebService + MySQL to return the result in my Android application. I have these tables: QueryIneedtoqueryaperson(tb_suspeito),withtheattributes(Name,cpfandRg).PreparedStatementstat...
asked by 30.10.2014 / 13:23
1
answer

COUNT and GROUP BY in two columns

Personal I am facing a question with a particular Query, I have already cataloged everywhere on the subject but without success. If there is another way to do what I'm trying, I'll thank you for the information So, I'll illustrate the scena...
asked by 19.11.2017 / 08:12
2
answers

Calculating average time

In my database I have a table that has the fields entrada , saida , the two fields have the format D-MM-YYYY H:M:S , I would like to do an average calculation. Ex: The average wait time is 30 min Based on all the results...
asked by 04.09.2017 / 14:52
1
answer

What does this piece of sql statement mean?

I have this statement in the database modeling file and would like to know what it is about. 'price_type' enum("S" "M")     
asked by 27.06.2016 / 12:38
1
answer

How do I change everything to a single php value

My question is this: In a table, I have a column named nomecliente . In this table I have several records, however the column nomecliente of the records are different from each other. How could I make a mysql_query UPDAT...
asked by 29.07.2016 / 21:34
3
answers

How to sort sql queries in the RUBY on Rails model?

I have the following method an ROR application. query_student = "SELECT name, registration, room FROM students WHERE registration = "+ params[:registration]+" AND password = "+params[:password] @student = ActiveRecord::Base.connection.exe...
asked by 19.08.2016 / 19:56
1
answer

Select data from two tables to display in a column?

Consider the tables for the customer registry: Person Table |ID|NOME|TIPO|EMAIL| Physical Table |ID|CPF| Legal person table |ID| CNPJ| inscricao_municipal| inscricao_estadual| My goal is to consult the data of all people,...
asked by 26.01.2016 / 19:20
2
answers

Pass SQL value to a VB.Net variable?

I have this code that executes a SQL: strsql = "select Nome, Senha from users where Nome=@field1 and Senha=@field2" objcmd = New Data.MySqlClient.MySqlCommand(strsql, objconn) With objcmd .Parameters.AddWithValue("@field1", "valor1") ....
asked by 13.10.2017 / 01:37
2
answers

C # how to do database search using parameters

I have the following code public DataTable PesquisarPorNome(string NomePesquisado) { try { DataTable tabela = new DataTable(); SqlDataAdapter adaptador = new SqlDataAdapter("SELECT * FROM tbEspecialidades WHERE NomeEspe...
asked by 27.11.2015 / 18:04
1
answer

How to do a SELECT between two tables and their WHERE's?

I get the category ID, and with it I look for the subcategories. For this I am using WHERE's. How would you use INNER JOIN? The WHERE's question confused me <?php namespace Application\Models; use Application\Models\Model; c...
asked by 29.01.2017 / 04:23