Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Uma linha origem , duas no final
Message
De
05/05/2003 11:51:04
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivie
 
 
À
05/05/2003 11:34:49
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Divers
Thread ID:
00784971
Message ID:
00784985
Vues:
14
This message has been marked as the solution to the initial question of the thread.
>Pessoal
>
>Numa Tabela tenho código , Valor a Débito , Valor a Crédito ,
>
>Ou seja Tabela1 têm os campos Cod , ValDeb , ValCre
>
>é possível que um registo , tenha por exemplo simultanemente um valor a débito e outro a crédito , por exemplo :
>
>Codigo1 , 50 , 20
>
>outro exemplo possível
>
>Codigo2 , 25 , 0
>
>Eu quero fazer um select que retorne um registo para o valor a débito , outro para valor a crédito , pegando nos exemplos acima , ficaria :
>
>Codigo1 , 50 , 0
>Codigo1 , 0 , 20
>Codigo2 , 25 , 0
>
>Fiz-me entender ?
>
>Muito obrigado pela ajuda
>
>Pedro Silva

Eu asumirei que ussa campos monetarios:
select codigo, debito, $0 as credito;
  union;
  select codigo, $0 as debito, credito;
  into cursor Temp;
  nofilter
select * from Temp;
  where debito # 0 or credito # 0;
  order by ...;
  into cursor Temp
HTH,

Hilmar.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform