I have two tables one "students" with enrollment and enrollment and another "do" with the students' grades in certain tests. I used the pivot command in the table "do_test" to transform the name of the tests into columns and the notes in lines,...
How can I convert this code sql into eloquent ?
SELECT
CONCAT(FLOOR(sum(diferenca)/60),'h',MOD(sum(diferenca),60),'m') as tempo
FROM
(SELECT
TIMESTAMPDIFF(MINUTE, m1.created_at, min(m2.created_at)) as diferenca
FROM
me...
I would like to use grupo_concat for filename and answer but would not repeat the values of filename and answer
Follow sqlfiddle:
link
It is a question that has 2 images and 4 alternatives of A-D....
I have a EUW0 field 10598260, and needed to be EUW 1598260
I need to remove a specific field
SQL:
SELECT 'EUW' + substring(campo,patindex('%[^EUW0 ]%',campo + ' ')
,len(campo)) AS campo1
,campo2
FROM [tabela]
WHERE...
Hello, I'm new to SQL and am having a question. As in the example below, I wanted to get a description of the code in the 'a' table from a table 'b'. But the number of rows in table 'a' when I do this increases significantly.
select a.banana,...
I'm facing a problem with two separate queries in oracle . Both have the sql% share of%
The error that returns is REPLACE(dbms_lob.substr(wm_concat(disctinct <COLUNA>)), ',', ', ') .
I looked for the error in ORA-22922...
I have a "mega-heavy" SQL file that does not open either in sublime, in notepad or in gedit. I just need to delete the first line Use nome_database; to be able to import through the workbench or mysql command line in the terminal: mys...
Hello, I have the following query:
set NOCOUNT on;
declare @_mes int = 2
declare @_ano int = 2016
declare @_dataini datetime = CONVERT(DATETIME, '01/' + REPLICATE('0', 2 - LEN(@_MES)) + CAST(@_MES AS VARCHAR(2)) + '/' + CAST(@_ANO AS VARCHA...
I have two tables:
Users:
id | nome | email
submissions:
id | id_envia | id_recebe
Every time a user sends a card (which goes by email) to another user, it marks this table, and every time it receives a tag as well.
Doubt:
I...
I have the following DB:
WhenIrunthefollowingQuery:SELECTtbCelula.*FROM(((tbTiposMonitorizacaoINNERJOINtbMonitorizacaoProjONtbTiposMonitorizacao.TM_ID=tbMonitorizacaoProj.MP_T_ID)INNERJOINtbListaConformidadesONtbMonitorizacaoProj.MP_ID=tbListaC...