![]() |
![]() |
| Paypal | FTP | CCD | Buscar | Trucos | Trabajo | Foros |
|
|||||||
| Registrarse | FAQ | Miembros | Calendario | Guía de estilo | Temas de Hoy |
|
|
Herramientas | Buscar en Tema | Desplegado |
|
#6
|
||||
|
||||
|
Hola,
Se pasaron, es increible el poder de de un select usado correctamente, Gracias señores. Tomando el ejemplo de nuestro amigo "jachguate" Código:
Select t1.campo1, t1.campo2
from tabla t1
where t1.campo1 = (select min(t2.campo1)
from tabla t2
where t2.campo2 = t1.campo2)
Código:
Select t1.campo1, t1.campo2, t1.campo5
from tabla t1
where t1.campo1 = (select min(t2.campo1)
from tabla t2
where t2.campo2 = t1.campo2)
Les cuento que mientras no sabia como actualizar el "campo5" tuve que ingeniarmelas para conseguir modificar/actualizar el "campo5". Conseguir actualizar el "campo5" en base a filas unicas por el "campo2" hice una pequeña rutina en delphi que me permitio actualizar el "campo5" mas no obtuve un cursor. , pero sali del apuro procedure TForm1.Button1Click(Sender: TObject); Var __xVar1, xVar2:String; Begin __ibtransaction1.Active:=false; __ibtransaction1.StartTransaction; __ibquery1.open; __ibquery1.First; __xVar1:='__'; __while not ibquery1.Eof do begin ____xVar2:=ibquery1.FieldValues['CAMPO2'] ____If xVar1<>xVar2 then Begin ______xVar1:=ibquery1.FieldValues['CAMPO2'] ______ibquery1.edit; ______ibquery1.FieldByName('CAMPO5').asString:='Y'; ______ibquery1.post; ____end; ____ibquery1.Next; __end; __showmessage('Ok...'); end; Your friend StartKill Lima-Perú Última edición por StartKill fecha: 05-03-2004 a las 20:53:05. Razón: Mal nombre del moderador |
|
|
|