Questions tagged as 'sql'

1
answer

Get data according to date in MySQL

I need to provide the option to view the data according to a time X determined by the user, for example I want the data from 03/01/2011 to 12/25/2014 How can I do this with MySQL? How do I set the table so everything can work out?     
asked by 26.12.2014 / 03:33
1
answer

String or Cursor in Oracle PLSQL

Good afternoon, I have a procedure that executes a select, but I work with a bitmap, where I use conditionals to perform a specific select depending on the bit that is passed as a parameter to the procedure. In this scenario I use a varchar v...
asked by 23.12.2014 / 18:34
1
answer

Change MySQL column information with UPDATE

In summary through PHP below I can send the specific information already registered in the column in the BD, but in addition to just "emitting" the data there, I would like a function that would change such information without changing the page...
asked by 26.12.2014 / 18:36
1
answer

Define the size of the field return

I have a sql: Select a.nome From tabela a I want to return the name, but suppose my name field has Varchar size (100), but I want to return the first 50 characters. Edit: Is for IBM Informix     
asked by 28.05.2015 / 16:44
1
answer

Passing parameters to procedure in postgresSQL

I will create a trigger in postgreSQL to copy information from one table to another, the tables will always have the same structure, so I want to pass the table names, make a WHILE and copy the files from one to another, but I can not remember...
asked by 17.12.2014 / 13:15
1
answer

How do I insert any file extension into a SQL database? [closed]

I have always worked by attaching only images to my BDD tables, I remember converting to MemoryStream and then to Byte and inserting ... But I need to insert any kind of file extension into my database.     
asked by 11.12.2014 / 19:54
1
answer

Create a conditional using the relational model

I'm trying to create a "conditional" or "just using the relational paradigm: Since the tables pessoa , cliente , funcionario and considering that a person can be a client or be an employee (a 1: 1 ratio, not null), it would...
asked by 13.09.2014 / 03:01
2
answers

Query about query performance with date range

Assuming that I have a database table with 10000 data and each record is registered with dates between 2013 and 2014. A query like this: SELECT CAMPO_DATA FROM TABELA WHERE CAMPO_DATA BETWEEN '2013-01-01' AND '2014-12-31' will be faster...
asked by 28.07.2014 / 23:00
1
answer

List grouped and filtered data

I am doing a query in PUBS, the database that is used in the MSDN tutorials for SQL Server, and I can not find a way to do it. The two tables I use are publishers and titles that have published book information and their publishers. I...
asked by 07.07.2014 / 19:28
2
answers

Filter string field snippet in MySQL

I'm having difficulty getting only the zip code of a field in which the address data is not atomic, I'd like to know a way using MySQL to get only the 8 numeric values of the ZIP code from the field of all records in the database which contain 8...
asked by 07.05.2014 / 03:15