Questions tagged as 'sql'

2
answers

Search multiple tables at once

Colleagues. I need to search multiple tables (a total of 28) where each table corresponds to a state in Brazil. This search would be from the CEP, which is one of the fields of these tables. Inner Join I do not know if it would be the solutio...
asked by 18.01.2017 / 18:31
2
answers

Return records field Timestamp ()

I have a table named interessados , I have int_data this field is timestamp() , I have 5 records with the following dates: 2016-09-01 10:15:00 2016-09-01 10:50:00 2016-09-01 18:35:00 2016-09-01 23:15:00 2016-09-15 10:00:00...
asked by 09.09.2016 / 21:00
2
answers

Single line and column result for multi-line column [closed]

I have a function in SQL that returns a single row in a single column with records separated by periods. Example: Column 1: Result Line 1: 0000000.0000001.0000002.0000003.0000004.0000005.0000006 I would like to insert each value o...
asked by 06.01.2017 / 19:47
1
answer

Insert same data into two MySQL columns

Hello! I have a table with the name tabx and two columns y and z, when I will insert the values in the column and I need a trigger to copy this value to the z-column. Have I tried some solutions but unsuccessfully can someone help me?     
asked by 06.01.2017 / 23:15
1
answer

How to assign query cost to a variable in Postgres

To get the estimated cost of the query I use EXPLAIN SELECT coluna FROM tabela; , to get the current cost of the query I use EXPLAIN ANALYSE SELECT coluna FROM tabela; , my question is how to fetch the cost of the query automatic...
asked by 26.09.2016 / 22:49
1
answer

How to select all the columns in the database

How to select all the columns in the database with the names 'name' and 'date' I have the code <?php $sql = "??"; if ($rs = $bd->query($sql)) { while ($row = $rs->fetch_assoc()) { echo $row['data']; echo...
asked by 23.09.2016 / 03:27
1
answer

C # ComboBox and SQL

I would like to know how to load values in a combobox, listing an entire column of the database, for example, I have a column that is called "Beer" and has several names, I would like to list that column in a ComboBox. Thanks. I have a Stored...
asked by 21.09.2016 / 01:25
2
answers

Insert special characters into mysql and pull these identical values in the web application [duplicate]

Good evening, I need to add values to the database by mysql so that they have special characters. I can add, but I can not pull the values correctly, they end up coming with symbols in place of the special characters, for example ... Comput...
asked by 27.07.2017 / 05:09
2
answers

Modify foreign key for auto-increment

I have two tables in my bank membro, membro_grupo, grupo The grupo table has a column named id_grupo which is the primary key in this table. The membro table has a column named id_membro which is also a primary k...
asked by 31.07.2016 / 19:05
1
answer

Return a CURSOR of a SqlServer procedure with dynamic sql (sp_executesql)

In oracle I can do as follows: OPEN MY_CURSOR FOR 'SELECT * FROM MY_TABLE' How to get this result in SqlSever? I want to return a cursor by mounting a dynamic sql in the procedure. I'm currently using it like this: CREATE PROCEDURE MY_PRO...
asked by 13.07.2016 / 13:39