Questions tagged as 'sql'

1
answer

0097 - missing parentheses to the right. - Can help

I know there are some discussions here in the forum about this error 0097 - missing parentheses on the right .. Here is my command, can you help me? select distinct Coalesce(Sum(Case When FI_TITULO.ABERTOQUITADO = 'Q' Then 0 Else (FI_TITULO.VL...
asked by 21.09.2018 / 15:05
1
answer

SQL To Count If It Is Greater Than 1

My problem is this: I have to make a condition if the SEQ_VENDA has more than 001 NUMBER, it bring the SELECT data. And if you have only 1 NUMBER referring to SEQ_VENDA do not bring in SQL     
asked by 23.10.2018 / 15:09
1
answer

Reason for using cursors in databases

I understand what a cursor is, but I do not understand it and I can not get anyone to show me a real reason to use them. Why should I use cursors? I want answers based on Oracle, SQL Server and MySQL and the difference in the use of cursors b...
asked by 09.09.2017 / 18:37
1
answer

Discover user password through Select or View? [closed]

I'm running a BD that was done by a developer who created a table of operators, it happens that he is no longer in the world of the living. How to find a user's password through a table or a View using SELECT * FROM ?     
asked by 12.09.2017 / 17:51
1
answer

How to return an answer from sql?

This is my first post in a forum, so I apologize if I make a mistake. This is the following, I need to register a book in the bank, but before that, I would need to know if the author is already registered in the bank, or if not, I must regis...
asked by 01.06.2018 / 05:18
1
answer

How to make an INNER JOIN in a single table with 3 keys?

I have a table that has the following structure: origem|papel|campo018|campo040|mercado|Master_key| The Master_key column can have two values: 'NY' OR 'MS' , I'd like to compare the rows in which Master_key is equal to...
asked by 19.06.2018 / 20:49
1
answer

Error in my query ifnull. because? [closed]

Query is not red and blue works! SELECT * FROM posts LEFT JOIN (SELECT COUNT(id_rela_post), ifnull(qt_vezes, 0), para FROM rela_post GROUP BY para) post_detalhe on posts.id_post = post_detalhe.para     
asked by 26.02.2018 / 20:06
1
answer

SQL Search Specifies

Ola wanted to do a search in the database with and that only bring the response if conditions are reached used code. $sql2 ="SELECT * FROM 'link' WHERE 1 LIKE ds_url_orig='https://www.frasesdobem.com.br/frases-incriveis' AND ds_email_link_mod...
asked by 20.03.2018 / 16:34
1
answer

Generate Database Merge

I have a Database backup and for lack of documentation I need to generate the MER of it. I remember reading somewhere that there are programs that do this reverse engineering and generate MER. Could you help me with this?     
asked by 20.12.2017 / 13:10
4
answers

How do I do a SELECT then an INSERT [closed]

How do I do a SELECT and if it returns more than 1 record does the UPDATE and if it returns 0 records does the INSERT? Look how I've done here but it's not working: if(isset($_POST['submit'])){ $query = $conexao->prepare("SELECT id_m...
asked by 15.12.2015 / 21:19