Questions tagged as 'sql'

1
answer

MYSQL: Find subsequences in a sequence and group by ID

I have a table with the following result: ------------------ |seq | ID | ------------------ | 1 | 12345 | | 2 | 12345 | | 3 | 12345 | | 4 | 12345 | | 8 | 12345 | | 9 | 54321 | | 10 | 54321 | | 11 | 54...
asked by 27.05.2016 / 17:04
1
answer

Select with Sql and Dynamic Input

I'm trying to make the select below, which pulls data from an sql when you select the option, change the value in input to side, also coming from the sql database. What would be the best option? Follow the code. <tr> <t...
asked by 04.05.2016 / 13:54
1
answer

Importing backup of sql server from another server

I can not import a backup (.bak) into the sql generated on another server, it says that the database is not the same as the one I'm trying to import and tals, and I put the same name. Does anyone know what might be happening?     
asked by 16.04.2016 / 02:07
1
answer

Query MySQL with mixed ORDER BY?

My question is a bit boring to explain but I'll try to make it as simple as possible. I have the following tables in a MySQL database: produto , preco , preco_produto (mapping many to many), venda and itens_venda...
asked by 21.07.2016 / 15:49
1
answer

How to delete record of 2 tables being one containing 0 to left SQL SERVER

I have 2 tables in which one is inserted the records that come from a file txt and the other the records that come from a file excel . With this, I need to delete the records of the txt table that contain the excel...
asked by 20.04.2016 / 16:58
1
answer

Use FULL JOIN in MySQL

I needed to do a query that returns me in a line the data of a candidate plus the courses to which he applied, being that this data is in a relational table 'tblcandidatoCurso'. After some research I tried to use the FULL JOIN, but it always app...
asked by 14.04.2016 / 15:04
1
answer

SQL in propagated data

I need to hit the SQL below for the Oracle database. The idea is to retrieve the code from the Produto table associated with the code of the Matriz table. In this structure, Matriz is related to at least Fili...
asked by 06.04.2016 / 16:34
1
answer

Total SQL Records in all columns

I need to return the total records of the query in a column, repeated same, type this: However, the query is a bit annoying. A query of 106 rows, with multiple SUM () and with a mandatory ORDER BY. I can not use GROUP BY in this query beca...
asked by 05.04.2016 / 17:34
1
answer

Print variables from two foreach in a table in different columns - codeigniter

I'm trying to print a table that accesses the database and inserts the different values of each array in each column. The problem is not printing the values correctly. Controller: private function mostrar_resultados() { //vai buscar o...
asked by 21.05.2016 / 18:48
1
answer

SQL Select single categories sorted by popularity

I'm trying to get a list of categories that are in use and then sort them based on the number of records to be able to assemble a list of categories and use in the site filter. So they should follow these restrictions: Unique Categories; C...
asked by 19.05.2016 / 20:40