Questions tagged as 'sql'

1
answer

Help in SQL query ORACLE

Dependency column: T - Holder; And wife; F - Children; FA - Adoptive Son As per table above, how do I bring data only from ZIP codes that differ from Zip Code:    Owner Admilson has 2 children with a different cp, as well as   holder...
asked by 13.06.2017 / 22:47
2
answers

Query sql codeigniter

I have a table with dates and I would like to create a query that returns records with dates before the current day but I could not mount this query; below is my code and BD image: function get_late_events($sort = 'idevento', $order = 'asc', $...
asked by 01.07.2017 / 17:14
1
answer

Sorting a list by the current time and the next dated records

I have the following table containing the programming of the day of the week "Sunday" of a radio: (id, program, description, time_ini, end_time, link) I want to get the first 3 programs using the current time as a reference.     
asked by 01.05.2017 / 00:41
2
answers

UNION with 2 DATABASES, SQL

I need to integrate 2 TABLES from DB different into a same DGV . I found several tutorials, but none that helped me from configuration to the connection, at least not the way I work with the connections. Follow an ex. o...
asked by 26.04.2017 / 15:37
1
answer

How to interpret * in this query

I have here a% w / o%, which apparently is simple if it were not for the fact that I have these query ai, which I can not tell whether it is * , inner join or some other in the same family . I need to convert this left...
asked by 16.05.2017 / 17:44
2
answers

Do a procedure with SQL language that returns the number of clients that have no business done

I can not resolve this issue, I want it to show client numbers without primary key repeat, no business done, and show a warning if customers have business done. This error has appeared here. CREATE FUNCTION sem_negocios() RETURNS integer AS...
asked by 28.06.2017 / 03:45
2
answers

Format date when performing Update in the registry - PostgreSQL

I am saving in my database the date when a particular record is changed, but the format it is saved is (YYYY-MM-DD) , the SQL command used so far is the following: update public.transportadora set status = 'Ativo', user_update = 'Teste', data...
asked by 27.03.2017 / 22:20
4
answers

Select only the first line of the table [duplicate]

I need to select only row 1 from the table, I already used DISTINCT and it did not work Follow Query: select Max(remessa.dt_uso_inicio) as DATA_REMESSA ,min(dt_entorc_oficina)DATA_ABERTURA ,patr.nr_patrimonio AS PATRIMONIO from...
asked by 23.03.2017 / 17:19
2
answers

Insert query does not work in PHP

I have the following query that is not working in PHP, because if you run Sql it does not present any problems. sql= "INSERT INTO books (ISBN, Authorsname, Title, edition, year, publisher, category, quantityinstock, price) VALUES(".$ISBN.",...
asked by 20.04.2017 / 05:12
2
answers

WP_Query complex

I'm putting together a calendar of events in Wordpress and I need to list all the events of the week grouped by the current day. I have events that last only one day and others that last the whole month. I created the custom post type "Events" a...
asked by 19.04.2017 / 18:26