Questions tagged as 'sql'

3
answers

PDO Paging - Fatal error: Out of memory

I'm doing a paging, but it's generating a memory error. Is there any way to optimize or fix the crash? Or is it on the same server? Note : php.ini is set to 512 in memory. if (!(isset($_GET['pagenum']))) { $pagenum = 1; } els...
asked by 12.11.2015 / 19:28
2
answers

How to get data from two tables in the same column?

I have two tables in the database: Tabela1 Id Nome Sexo 1 NomeA Macho 2 NomeC Fêmea Tabela2 Id Nome Sexo 1 NomeB Macho 2 NomeD Fêmea I would like to have the following re...
asked by 30.07.2015 / 18:54
2
answers

cmd.CommandType = CommandType.Text - Why use?

Have a good day. I am populating a grid, and after searching the internet, I saw that some use the command: cmd.CommandType = CommandType.Text; My question is, why use? what's the difference? I did some testing here, and it works normall...
asked by 11.07.2016 / 13:18
2
answers

Use SQL LIKE to find a number followed by space

I have a field gathering values that are sequences of numbers separated by a comma, such as: "1, 2, 3, 23, 41, 54" I was using SQL within PHP to find a number within this field with LIKE, but the way I did it, if I wanted to find only 5, for e...
asked by 24.04.2015 / 16:29
3
answers

Repeat LEFT JOIN with other parameters in the same query

I have 2 tables: FATHER: id nome Child: id idpai sexo_filho I wanted to do a SELECT that sums up the amount of children man and women, that's the problem, I can only do with one of the sex: SELECT pai.nome, count(distinct filho.id...
asked by 02.10.2015 / 21:19
2
answers

Left join returning more records

I have a main table with about 5,000 records, and I need to fetch information from another table with 7,000 records. But my query is returning +6000: SELECT principal.id, info.nome, info.endereco, principal.valor FROM principal LEFT JOIN in...
asked by 30.12.2014 / 15:02
1
answer

OR returns result not expected

I'm running this function SELECT COUNT(id) FROM 'system_stats' WHERE 'name' = 1 OR 0 AND 'us_id' = 0 It returns a value equal to 1, but this 1 does not, when I execute separately in that way, it returns me 0, why with OR does it ret...
asked by 29.12.2014 / 02:20
2
answers

UTL_SMTP: Sending accents

Hello, I'm using Oracle XE 11.2 to send emails using the UTL_SMTP package, but whenever there are accents in the subject or message, it is replaced by a "?". What I have is the following: I have a procedure that contains the parameters for...
asked by 17.11.2014 / 14:45
1
answer

How to do these SQL requests?

I am developing a real estate portal but as it is the first time I do one, I do not know exactly how logic works to get the desired result. After tracing a path, I will still have to turn this into SQL requests. As can be seen in the image,...
asked by 04.10.2014 / 01:32
1
answer

How to search for multiple terms in a field?

My scenario and the following, I have an input where the user places the term and clicks search EX: car horizon [ENTER] But you're listing the result of the separated words EX: 3 results found id1 - house in belo horizonte id2 - a...
asked by 10.10.2014 / 03:35