Recent

Author Topic: SELECT - Criar sequencial multiplicativo  (Read 1033 times)

CapitaoVirgulinoFerreira

  • New member
  • *
  • Posts: 8
SELECT - Criar sequencial multiplicativo
« on: December 10, 2023, 04:02:01 am »
Pessoal, uma ajudinha.

Numa determinada tabela, tenho 2 campos.

Code: Pascal  [Select][+][-]
  1. SELECT ID, QUANTIDADE FROM TABELA WHERE ID=1001

o retorno é:

Code: Pascal  [Select][+][-]
  1. 1001 | 3

É possível criar um SELECT que retorne a seguinte forma?
Code: Pascal  [Select][+][-]
  1. 1001 | 3
  2. 1002 | 3
  3. 1003 | 3

« Last Edit: December 10, 2023, 04:24:17 am by CapitaoVirgulinoFerreira »

Zvoni

  • Hero Member
  • *****
  • Posts: 2737
Re: SELECT - Criar sequencial multiplicativo
« Reply #1 on: December 11, 2023, 08:14:52 am »
In English?
Which DBMS?
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

440bx

  • Hero Member
  • *****
  • Posts: 4727
Re: SELECT - Criar sequencial multiplicativo
« Reply #2 on: December 11, 2023, 08:23:29 am »
Code: Pascal  [Select][+][-]
  1. SELECT ID, QUANTIDADE FROM TABELA WHERE ID IN (1001, 1002, 1003)
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Zvoni

  • Hero Member
  • *****
  • Posts: 2737
Re: SELECT - Criar sequencial multiplicativo
« Reply #3 on: December 11, 2023, 09:31:53 am »
Code: Pascal  [Select][+][-]
  1. SELECT ID, QUANTIDADE FROM TABELA WHERE ID IN (1001, 1002, 1003)
So all three ID's have the same quantity....,
but i'm reading something like "sequential" and "multiplication" in the Subject-Title.... so... *shrug*
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

440bx

  • Hero Member
  • *****
  • Posts: 4727
Re: SELECT - Criar sequencial multiplicativo
« Reply #4 on: December 11, 2023, 09:37:54 am »
Your concerns are valid and I don't really know if what I suggested is what he is looking for but, I figured, at least it's a reasonable place to start.

I presume, he'll let us know how close (or far) my suggestion is from what he is looking for.
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

Zvoni

  • Hero Member
  • *****
  • Posts: 2737
Re: SELECT - Criar sequencial multiplicativo
« Reply #5 on: December 11, 2023, 10:24:28 am »
According to Google-Translate it's portuguese...... so might be Brazil... *gg*
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

 

TinyPortal © 2005-2018