Questions tagged as 'mysql'

2
answers

Syntax error in SELECT, in PHP [closed]

I'm putting the following code to make a query: SELECT * FROM tabela ORDER BY coluna WHERE ROWNUM = 5 However, when I put this in my PHP, the following message appears:    You have an error in your SQL syntax; check the manual that corre...
asked by 27.01.2016 / 19:16
2
answers

Query DELETE too slow to load

I'm having a problem with a query, it has the function of deleting some existing duplicate records in a table. Follows: DELETE t1 FROM bid_account t1 INNER JOIN bid_account t2 WHERE t1.id > t2.id AND t1.bidding_price = t2.bid...
asked by 11.04.2018 / 06:47
3
answers

Error with & within query mysql

Colleagues. I have a table that within the Days field brings: Second & Tuesday But when querying within PHP, it does not return anything, even if the query is correct: $sql = mysqli_query($con,"SELECT * FROM semana WHERE Dias...
asked by 09.08.2016 / 18:14
2
answers

MySQL - Select between 2 tables with field "String"

I would like to know how to do a Select to return non-existent records by comparing two tables with the String field. Example: Tabelas Campo1 Campo2 Tab1 Nome Tel Tab2 Nome email The result of the comparison (the select)...
asked by 26.07.2018 / 16:36
3
answers

MYSQL relationship between tables

I'm not very good with database relationships and I'm starting my studies. I would like to know why developers shorten when calling tables or if this is mandatory? SELECT p.*, c.'nome' AS categoria, u.'nome' AS usuario FROM 'produtos' AS p...
asked by 29.05.2017 / 20:56
2
answers

Get date with day of week, number of week, month and year

Is there any way to get the date if you only have the day of the week, the week, month, and year number with MySQL? Example: I want to know what day it is with these parameters: Year: 2014 Month: September (09) Week number of the y...
asked by 18.09.2014 / 19:55
3
answers

How can I split this INSERT in steps?

I have 70MIL records to insert into a table3 from table1 - 4 fields and table2 - 1 field . The following code does exactly what I need in the most optimized way a user has helped me build. INSERT INTO imagens3 (ID, IMOVEL, CODIGO, IMA...
asked by 19.01.2015 / 20:10
2
answers

Query in MySQL query

Query that I'm using SELECT os_id,os_data,os_processo,os_solicitante,os_tipo,os_cliente,os_empresa,os_adverso,os_local, os_comarca,os_advogado,os_preposto,os_documentos,os_status,login_nome, sum(osh.os_honorarios_valor) as honorario,sum(osh...
asked by 21.02.2018 / 02:03
3
answers

Mysql sorting by specific value by returning all values [duplicate]

Good afternoon, Is there any method in a sql query to sort from a value and if that value does it return it first and then all rest of the values? Example: A table with days from 1 to 7, where I would put in case there was a return value of...
asked by 16.03.2018 / 20:39
1
answer

Do a SELECT multiple tables and save in a worksheet

I'm trying to do a SELECT with multiple tables, where I have a product with your information, and I have another table structure to be able to add an extra field and their respective information. What I tried to do was this: SELECT p.codigo...
asked by 30.07.2018 / 20:13