I'm trying to do a regular expression in Oracle with the following requirement:
Finish with a specific letter, if you have that letter in the middle do not search.
Return the first 3 digits of the string.
To solve the first problem I ca...
I have the following query:
select T1.dt_producao, T1.cod_turno, T1.cod_periodo,
CASE
WHEN T2.TP_PALLET = 'DZ' THEN
sum(T1.QT_PROD* T2.QT_EMBALAGEM*12)
ELSE
sum(T1.QT_PROD* T2.QT_EMBALAGEM)
END AS "APON.TOTAL",
(...
I use the sql server . I need to use a random number in several different columns (the same random number) but I want a new random number on each line ...
For example, let's assume that TABELAX has only 5 rows and I'll query the genre ......
I'm trying to get the longest date entered in my BD , I'm trying to use the MAX and DATE_FORMAT functions together and the search result is not as expected, I have these dates registered:
2016-10-24
2016-10-25
2016-10-26
2016-10-27
2016...
I have a lot of questions about MySQL when I have to use INNER JOIN to get data from other tables.
I have 3 tables:
MEDIA
id, user_id, title, description
COMMENTS
id, user_id, media_id, comment
MEDIA_LIKES
id,...
I am creating a table using PostgreSql and in it there will be a password field with MD5 encryption. How would the syntax be in it? Because I have more contact with MySQL than PostgreSQL.
I created this procedure but I can not execute it.
I have the following error when trying Execute:
PLS-00306: Incorrect number of argument types in call to 'SP_CARTAO'
CREATE OR REPLACE PROCEDURE SP_CARTAO
(
P_ID IN INT ,
P_ID_CAR...
I'm modeling a MySQL database where key entities are documents. Among several other fields, these documents relate to one or more phases of a given project.
There are 4 basic values (let's call them A, B, C and D), and the phase property...
Description:
Count how many times the action occurred in the night time considering the time from 6:00 p.m. to 6:00 p.m.
There is a better way to do such a select without having to use or
to compare the periods?
select count(*) as contado...