Questions tagged as 'sql'

2
answers

SQL query with error in Java [closed]

I am trying to make a webapp in java, but I am a beginner, in the part of login of the app, I created a routine that receives as parameter an object and performs a search in the database according to the object that contains login = otavio e pas...
asked by 14.11.2014 / 01:20
3
answers

Export query in SQL Server to CSV file

I need to somehow export the result of my SQL query to a CSV file. However, it has to be directly via SQL or VBS. Or, you can export all the data from the database table to CSV.     
asked by 04.04.2017 / 12:37
3
answers

Only the first row of the table being displayed!

I am requesting the table data this way: $sql = "SELECT * FROM 'login' order by 'userid' DESC"; $limite = mysqli_query($db, $sql); while ($sql = mysqli_fetch_array($limite)) { $account_id = $sql['account_id']; $userid = $sql['useri...
asked by 25.03.2015 / 13:06
2
answers

How can I select a range of items, after some values using SQL IN operator

For example: I want to search, 1,2,5,7,11 and then the rest until 100, in a DQL SELECT. Ex.: SELECT column_name(s) FROM table_name WHERE column_name IN (1,2,5,7,11 ... value100); In case my doubt is regarding the use of the IN operator, i...
asked by 24.05.2018 / 20:15
1
answer

Assemble an ALTER TABLE script

I have this select that returns me the name of the tables that interest me: SELECT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME LIKE '%_AUD' AND COLUMN_NAME = 'REVTYPE' GROUP BY TABLE_NAME; From this result I would like to pu...
asked by 11.04.2018 / 18:31
2
answers

How to count the number of records in a selection in a table

I made a selection of all the results of a table. What I need is to show the amount of these results. In my case, I need to show how many different specialties there are SELECT "especialidade" FROM funcionarios GROUP BY "especialidade"...
asked by 08.03.2018 / 22:13
2
answers

Concatenate text to an existing SQL column

I have the following SQL : UPDATE tabela SET peso = peso "KG" I need to add the KG tag to the weight field, but if I do it the way I did it does not work. How could I do it?     
asked by 28.02.2018 / 16:11
1
answer

Error using Case and Select in PL-SQL

I have this code: DECLARE BEGIN SELECT p.categoria( CASE WHEN p.categoria = 'A' THEN DBMS_OUTPUT.PUT_LINE('A') ELSE 2000 END ) FROM PRODUTO_TESTE2 p; END; Error message:    Error Reporting - ORA-06550: li...
asked by 24.01.2018 / 20:50
5
answers

Copy a word from a column to the end

I have several records in sql eg almedia,jose costa santos and I want to change the value to: jose costa santos almeida So I want to get the surname that is in the beginning (before the comma) and put it at the end, but I do not know h...
asked by 02.02.2016 / 12:05
2
answers

Make selection from the results obtained from the same

Good afternoon, I have the following table .. *eventos* ---------------------------------------- | id_evento | id_projeto | nome_evento | ---------------------------------------- I need to do a procedure as follows: "Select events w...
asked by 23.10.2017 / 22:38