Questions tagged as 'sql'

2
answers

Format year in SQLite

I need to format a timestamp in the following format: DDMMYYHHMMSS I was able to use strftime , for example: select strftime("%d%m%Y%H%M%S", current_timestamp) from stream; But this way it shows 4 digits for the year and I only need...
asked by 30.03.2018 / 21:00
2
answers

Display number of results of a SQL query [closed]

I have a resident registration system, I would like to display the quantity of records that result from my SQL lookup on my form in Visual Studio The SQL code is as follows SELECT * FROM PERGUNTAS WHERE BAIRRO = 'MCMV - INOÃ' In SQL Serv...
asked by 11.03.2018 / 21:02
1
answer

SQL query without element repeated

I have this query in sql SELECT "Certificates"."Email", "Organizations"."CommonName", "Certificates"."Id", "Certificates"."OrganizationId" FROM "Certificates" INNER JOIN "Organizations" ON "Organizations"."Id" = "C...
asked by 02.03.2018 / 17:28
1
answer

What is the use of using BaseColumns._ID to define a contract class in SQLite?

Why should I use BaseColumns._ID instead of simply setting a String to _id ? For example, instead of using: public static final String _ID = BaseColumns._ID; Would not it be simpler to use this? public static fina...
asked by 25.02.2018 / 21:08
2
answers

VIEW and JOIN, return the product, and the value with the most recent date!

I have the following tables that I created. CREATE TABLE produto ( codigo INT UNSIGNED NOT NULL AUTO_INCREMENT, nome VARCHAR(128) NOT NULL, url VARCHAR(255) NOT NULL, qde_min SMALLINT UN...
asked by 23.02.2018 / 21:24
2
answers

Function MAX only 1 (one) record in Oracle

Can anyone help me with Oracle's Function MAX ()? I need to do a query that returns only the last record of a history table, but I need to return 3 (three) columns of that record - > Id, Ticket_id and Queue_id, but if I use the query as be...
asked by 19.03.2018 / 23:32
1
answer

Field as parameter in Generic Update - ORACLE

I currently have a procedure that reads an XML, and does an update on the fields of the physical_person table based on the values sent by the XML, such as CPF, RG, Name, etc. Today I read the XML values and insert into the table variable....
asked by 26.02.2018 / 16:08
1
answer

Problem with full outer join doing the filter with where

Friends, I have a database with the following tables: types id | nome 1 | Duplo 2 | Triplo availability data | tipo | ocupado | manutencao | referencia 01/03/2018 | 1 | 1 | 0 | 54684 01/03/2018 | 1 |...
asked by 26.02.2018 / 21:01
1
answer

Transform 2 Select Simple to 1

I have the following table PLAYLIST where I have the columns VIDEO and STATUS : VIDEO | STATUS The status column varies between 1 and 0 being 1 for new videos and 0 for videos that have...
asked by 03.04.2018 / 21:16
1
answer

How to do the select of two tables in mysql? [duplicate]

I know this should be an easy question, but I'm a beginner: I have these 3 tables in my bank: In this case, the purchased table is where the cpf of the user who purchased the course is stored and saves the course id. I think that's...
asked by 06.02.2018 / 23:09