Questions tagged as 'sql'

1
answer

SELECT with REGEXP

Next, I have a people table: [name, enrollment, cpf] What happens is, some people who have the "same" cpf have different license plates. The [same] is in quotation marks, because in the database, there are cpfs like in this example: 1)...
asked by 18.11.2016 / 02:44
1
answer

Dynamic Combobox with Codeigniter 3

The basic idea is similar to the combobox of states and cities , that when selecting a state, the next select returns the referring cities. In my case I can not list these fields in the second select (which would be equivalent to cities)....
asked by 07.10.2016 / 21:59
1
answer

Select transforming different records into single

I need to make a select by unifying two different rows into one, with two new columns. I am using bd oracle and there is no possibility to perform update in the tables. Example:     
asked by 05.10.2016 / 22:02
2
answers

Check if the record already exists, if it does not change the value (MYSQL)

PHP FUNCTIONS <? if($_REQUEST['salva_ed']){ $sqlu="update registration set username='$username', firstname='$fname', lastname='$lname', sex='$gender', birth_date='$bdate', addressline1='$address1',addressline2='$address2'...
asked by 06.10.2016 / 21:48
1
answer

Hierarchical database (?) - SQLite / Android [closed]

Good afternoon, I'm starting to study Android and thought of making an application to already study database together. I want to make a "family tree", so that clicking on the name of the person (button) would appear other buttons with the names...
asked by 26.09.2016 / 22:20
1
answer

How to do a search in an app using AngularJS with parameter passing correctly?

How to do a search in an app using AngularJS with parameter passing correctly, when I speak correctly I mean to avoid SQL Injection. For example; the var parameters = "joao"; parameter in the query below. self.searchAll = function(na...
asked by 26.08.2016 / 20:18
1
answer

Information in multiple tables or just one? [closed]

I have a lot of information that I need to save to the database. Some of this information is very similar: Example: time1, time2, time3, ... hour10. My question is whether to store everything in the same table or create a table for the inf...
asked by 01.09.2016 / 19:06
1
answer

Query Table versus View Table: What is the best practice? [duplicate]

What is the best practice for querying in banco de dados , performing a direct query on table or view of it? What are the advantages and disadvantages between them?     
asked by 17.08.2016 / 14:36
1
answer

Select using Join with Distinct

I have two tables: tb_movement | cod | dt_producao | qt_prod | |-----|--------------|---------| | 1 | '04.08.2016' | 10 | | 2 | '04.08.2016' | 5 | | 3 | '09.08.2016' | 12 | | 4 | '10.08.2016' | 3 | tb_ro...
asked by 24.08.2016 / 15:07
1
answer

relationship between SQL tables [closed]

I have the following problem, I have two stocks in my company, so I have two values for the stock, and the stock record looks something like this: Astheimageshows,eachproducthastworecords,eachreportingthequantityofeachstock.Icannotchangethew...
asked by 24.08.2016 / 07:47