IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

SQL Oracle Discussion :

Simplification de requête [10g]


Sujet :

SQL Oracle

Mode arborescent

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Homme Profil pro
    Cadre
    Inscrit en
    Septembre 2013
    Messages
    83
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Haute Garonne (Midi Pyrénées)

    Informations professionnelles :
    Activité : Cadre
    Secteur : Aéronautique - Marine - Espace - Armement

    Informations forums :
    Inscription : Septembre 2013
    Messages : 83
    Par défaut Simplification de requête
    Bonjour à tous,
    peut_on dans la requête suivante supprimer les cases vides entre les valeurs?
    Peut importe le nombre de valeurs dans chaque lignes, je souhaiterai les rammener dans les premières colonnes.
    Code sql : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    SELECT phof_orfa_numero
       , MAX(DECODE (phof_numero_phase,'2',phof_post_code)) AS "1"
       , MAX(DECODE(phof_numero_phase,'9',phof_post_code)) AS "2"
       , MAX(DECODE(phof_numero_phase,'10',phof_post_code)) AS "3"
       , MAX(DECODE(phof_numero_phase,'20',phof_post_code)) AS "4"
       , MAX(DECODE(phof_numero_phase,'25',phof_post_code)) AS "5"
       , MAX(DECODE(phof_numero_phase,'30',phof_post_code)) AS "6"
       , MAX(DECODE(phof_numero_phase,'35',phof_post_code)) AS "7"
       , MAX(DECODE(phof_numero_phase,'40',phof_post_code)) AS "8"
       , MAX(DECODE(phof_numero_phase,'50',phof_post_code)) AS "9"
       , MAX(DECODE(phof_numero_phase,'60',phof_post_code)) AS "10"
       , MAX(DECODE(phof_numero_phase,'70',phof_post_code)) AS "11"
       , MAX(DECODE(phof_numero_phase,'80',phof_post_code)) AS "12"
       , MAX(DECODE(phof_numero_phase,'90',phof_post_code)) AS "13"
       , MAX(DECODE(phof_numero_phase,'100',phof_post_code)) AS "14"
       , MAX(DECODE(phof_numero_phase,'110',phof_post_code)) AS "15"
       , MAX(DECODE(phof_numero_phase,'120',phof_post_code)) AS "16"
       , MAX(DECODE(phof_numero_phase,'130',phof_post_code)) AS "17"
       , MAX(DECODE(phof_numero_phase,'140',phof_post_code)) AS "18"
       , MAX(DECODE(phof_numero_phase,'150',phof_post_code)) AS "19"
       , MAX(DECODE(phof_numero_phase,'160',phof_post_code)) AS "20"
       , MAX(DECODE(phof_numero_phase,'170',phof_post_code)) AS "21"
       , MAX(DECODE(phof_numero_phase,'180',phof_post_code)) AS "22"
       , MAX(DECODE(phof_numero_phase,'190',phof_post_code)) AS "23"
       , MAX(DECODE(phof_numero_phase,'200',phof_post_code)) AS "24"
       , MAX(DECODE(phof_numero_phase,'210',phof_post_code)) AS "25"
       , MAX(DECODE(phof_numero_phase,'220',phof_post_code)) AS "26"
       , MAX(DECODE(phof_numero_phase,'230',phof_post_code)) AS "27"
       , MAX(DECODE(phof_numero_phase,'240',phof_post_code)) AS "28"
       , MAX(DECODE(phof_numero_phase,'250',phof_post_code)) AS "29"
       , MAX(DECODE(phof_numero_phase,'260',phof_post_code)) AS "30"
       , MAX(DECODE(phof_numero_phase,'270',phof_post_code)) AS "31"
       , MAX(DECODE(phof_numero_phase,'280',phof_post_code)) AS "32"
       , MAX(DECODE(phof_numero_phase,'290',phof_post_code)) AS "33"
       , MAX(DECODE(phof_numero_phase,'300',phof_post_code)) AS "34"
       , MAX(DECODE(phof_numero_phase,'310',phof_post_code)) AS "35"
       , MAX(DECODE(phof_numero_phase,'400',phof_post_code)) AS "36"
       , MAX(DECODE(phof_numero_phase,'450',phof_post_code)) AS "37"
       , MAX(DECODE(phof_numero_phase,'490',phof_post_code)) AS "38"
       , MAX(DECODE(phof_numero_phase,'491',phof_post_code)) AS "39"
       , MAX(DECODE(phof_numero_phase,'492',phof_post_code)) AS "40"
       , MAX(DECODE(phof_numero_phase,'493',phof_post_code)) AS "41"
       , MAX(DECODE(phof_numero_phase,'494',phof_post_code)) AS "42"
       , MAX(DECODE(phof_numero_phase,'495',phof_post_code)) AS "43"
       , MAX(DECODE(phof_numero_phase,'496',phof_post_code)) AS "44"
       , MAX(DECODE(phof_numero_phase,'497',phof_post_code)) AS "45"
       , MAX(DECODE(phof_numero_phase,'498',phof_post_code)) AS "46"
       , MAX(DECODE(phof_numero_phase,'499',phof_post_code)) AS "47"
       , MAX(DECODE(phof_numero_phase,'500',phof_post_code)) AS "48"
       , MAX(DECODE(phof_numero_phase,'510',phof_post_code)) AS "49"  
        FROM phase_of
        WHERE phof_statut = 'L'
        AND phof_orfa_numero = '201'
        GROUP BY phof_orfa_numero

    Merci d'avance.
    Fichiers attachés Fichiers attachés

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Simplification de requête
    Par Ludix_ dans le forum Langage SQL
    Réponses: 12
    Dernier message: 13/04/2012, 14h26
  2. Simplification de requêtes SQL
    Par XGuarden dans le forum VB.NET
    Réponses: 8
    Dernier message: 30/12/2010, 11h31
  3. Simplification de requête
    Par Louis-Guillaume Morand dans le forum SQL
    Réponses: 21
    Dernier message: 03/03/2008, 12h26
  4. simplification de requête
    Par GMI3 dans le forum Oracle
    Réponses: 3
    Dernier message: 03/05/2006, 14h47
  5. [Access] simplification de requètes.
    Par pmboutteau dans le forum Langage SQL
    Réponses: 14
    Dernier message: 02/02/2006, 09h04

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo