How do I SELECT FROM columns where the COLUMNS has a PATTERN?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martin@marketbridge.com.no.spam.now

    How do I SELECT FROM columns where the COLUMNS has a PATTERN?

    Hi there,

    I've been looking far and wide on this one. I'm looking for a way to
    select from columns where the columns have a certain pattern!

    Example:

    Instead of doing:

    SELECT q1, q2, q3, q4, q5, q6, q7, q8, q9 FROM exam

    I would like to do:

    SELECT q* FROM exam

    or

    SELECT q% FROM exam

    Whatever will match everything that has the letter q in it. Anyone
    have an idea? I've been banging my head on this one.

    Martin
    p.s. I would appreciate an e-mail as well if you replay

    martin@marketbr idge.com.no.spa med
  • deplexus

    #2
    Re: How do I SELECT FROM columns where the COLUMNS has a PATTERN?

    Martin@marketbr idge.com.no.spa m.now wrote:
    [color=blue]
    > Hi there,
    >
    > I've been looking far and wide on this one. I'm looking for a way to
    > select from columns where the columns have a certain pattern!
    >
    > Example:
    >
    > Instead of doing:
    >
    > SELECT q1, q2, q3, q4, q5, q6, q7, q8, q9 FROM exam
    >
    > I would like to do:
    >
    > SELECT q* FROM exam
    >
    > or
    >
    > SELECT q% FROM exam
    >
    > Whatever will match everything that has the letter q in it. Anyone
    > have an idea? I've been banging my head on this one.
    >
    > Martin
    > p.s. I would appreciate an e-mail as well if you replay
    >
    > martin@marketbr idge.com.no.spa med[/color]

    what about eval() function? If we mean PHP.


    Comment

    • deplexus

      #3
      Re: How do I SELECT FROM columns where the COLUMNS has a PATTERN?

      Martin@marketbr idge.com.no.spa m.now wrote:
      [color=blue]
      > Hi there,
      >
      > I've been looking far and wide on this one. I'm looking for a way to
      > select from columns where the columns have a certain pattern!
      >
      > Example:
      >
      > Instead of doing:
      >
      > SELECT q1, q2, q3, q4, q5, q6, q7, q8, q9 FROM exam
      >
      > I would like to do:
      >
      > SELECT q* FROM exam
      >
      > or
      >
      > SELECT q% FROM exam
      >
      > Whatever will match everything that has the letter q in it. Anyone
      > have an idea? I've been banging my head on this one.
      >
      > Martin
      > p.s. I would appreciate an e-mail as well if you replay
      >
      > martin@marketbr idge.com.no.spa med[/color]

      what about eval() function? If we mean PHP.


      Comment

      • deplexus

        #4
        Re: How do I SELECT FROM columns where the COLUMNS has a PATTERN?

        Martin@marketbr idge.com.no.spa m.now wrote:
        [color=blue]
        > Hi there,
        >
        > I've been looking far and wide on this one. I'm looking for a way to
        > select from columns where the columns have a certain pattern!
        >
        > Example:
        >
        > Instead of doing:
        >
        > SELECT q1, q2, q3, q4, q5, q6, q7, q8, q9 FROM exam
        >
        > I would like to do:
        >
        > SELECT q* FROM exam
        >
        > or
        >
        > SELECT q% FROM exam
        >
        > Whatever will match everything that has the letter q in it. Anyone
        > have an idea? I've been banging my head on this one.
        >
        > Martin
        > p.s. I would appreciate an e-mail as well if you replay
        >
        > martin@marketbr idge.com.no.spa med[/color]

        what about eval() function? If we mean PHP.


        Comment

        • Martin Laflamme

          #5
          Re: How do I SELECT FROM columns where the COLUMNS has a PATTERN? Agro


          To: Aggro

          I'm actually using PERL! I should use PHP but I don't have time to
          learn a new language. I'm thinking about what you said and the table
          structure. I think you've got some thing there.

          I cant use select * because there's other columns with other names

          Martin

          On Sun, 29 Feb 2004 15:55:41 GMT, Martin@marketbr idge.com.no.spa m.now
          wrote:
          [color=blue]
          >Hi there,
          >
          >I've been looking far and wide on this one. I'm looking for a way to
          >select from columns where the columns have a certain pattern!
          >
          >Example:
          >
          >Instead of doing:
          >
          >SELECT q1, q2, q3, q4, q5, q6, q7, q8, q9 FROM exam
          >
          >I would like to do:
          >
          >SELECT q* FROM exam
          >
          >or
          >
          >SELECT q% FROM exam
          >
          >Whatever will match everything that has the letter q in it. Anyone
          >have an idea? I've been banging my head on this one.
          >
          >Martin
          > p.s. I would appreciate an e-mail as well if you replay
          >
          >martin@marketb ridge.com.no.sp amed[/color]

          Comment

          • Martin Laflamme

            #6
            Re: How do I SELECT FROM columns where the COLUMNS has a PATTERN? Agro


            To: Aggro

            I'm actually using PERL! I should use PHP but I don't have time to
            learn a new language. I'm thinking about what you said and the table
            structure. I think you've got some thing there.

            I cant use select * because there's other columns with other names

            Martin

            On Sun, 29 Feb 2004 15:55:41 GMT, Martin@marketbr idge.com.no.spa m.now
            wrote:
            [color=blue]
            >Hi there,
            >
            >I've been looking far and wide on this one. I'm looking for a way to
            >select from columns where the columns have a certain pattern!
            >
            >Example:
            >
            >Instead of doing:
            >
            >SELECT q1, q2, q3, q4, q5, q6, q7, q8, q9 FROM exam
            >
            >I would like to do:
            >
            >SELECT q* FROM exam
            >
            >or
            >
            >SELECT q% FROM exam
            >
            >Whatever will match everything that has the letter q in it. Anyone
            >have an idea? I've been banging my head on this one.
            >
            >Martin
            > p.s. I would appreciate an e-mail as well if you replay
            >
            >martin@marketb ridge.com.no.sp amed[/color]

            Comment

            • Martin Laflamme

              #7
              Re: How do I SELECT FROM columns where the COLUMNS has a PATTERN? Agro


              To: Aggro

              I'm actually using PERL! I should use PHP but I don't have time to
              learn a new language. I'm thinking about what you said and the table
              structure. I think you've got some thing there.

              I cant use select * because there's other columns with other names

              Martin

              On Sun, 29 Feb 2004 15:55:41 GMT, Martin@marketbr idge.com.no.spa m.now
              wrote:
              [color=blue]
              >Hi there,
              >
              >I've been looking far and wide on this one. I'm looking for a way to
              >select from columns where the columns have a certain pattern!
              >
              >Example:
              >
              >Instead of doing:
              >
              >SELECT q1, q2, q3, q4, q5, q6, q7, q8, q9 FROM exam
              >
              >I would like to do:
              >
              >SELECT q* FROM exam
              >
              >or
              >
              >SELECT q% FROM exam
              >
              >Whatever will match everything that has the letter q in it. Anyone
              >have an idea? I've been banging my head on this one.
              >
              >Martin
              > p.s. I would appreciate an e-mail as well if you replay
              >
              >martin@marketb ridge.com.no.sp amed[/color]

              Comment

              • Jay

                #8
                Re: How do I SELECT FROM columns where the COLUMNS has a PATTERN? Agro

                Maybe you could get an array of column names using NAME and filter out the
                ones you want with perl.

                NAME
                Returns a reference to an array of column names. Example:
                $names = $sth->{NAME};


                For instance, I use this to get the col names:

                foreach $n (@{$sth->{NAME}}){
                print "NAME: $n\n";
                }



                "Martin Laflamme" <courses@market bridge.com.no.s pam.now> wrote in message
                news:4044b74f.9 8168765@news.is top.com...[color=blue]
                >
                > To: Aggro
                >
                > I'm actually using PERL! I should use PHP but I don't have time to
                > learn a new language. I'm thinking about what you said and the table
                > structure. I think you've got some thing there.
                >
                > I cant use select * because there's other columns with other names
                >
                > Martin
                >
                > On Sun, 29 Feb 2004 15:55:41 GMT, Martin@marketbr idge.com.no.spa m.now
                > wrote:
                >[color=green]
                > >Hi there,
                > >
                > >I've been looking far and wide on this one. I'm looking for a way to
                > >select from columns where the columns have a certain pattern!
                > >
                > >Example:
                > >
                > >Instead of doing:
                > >
                > >SELECT q1, q2, q3, q4, q5, q6, q7, q8, q9 FROM exam
                > >
                > >I would like to do:
                > >
                > >SELECT q* FROM exam
                > >
                > >or
                > >
                > >SELECT q% FROM exam
                > >
                > >Whatever will match everything that has the letter q in it. Anyone
                > >have an idea? I've been banging my head on this one.
                > >
                > >Martin
                > > p.s. I would appreciate an e-mail as well if you replay
                > >
                > >martin@marketb ridge.com.no.sp amed[/color]
                >[/color]


                Comment

                • Jay

                  #9
                  Re: How do I SELECT FROM columns where the COLUMNS has a PATTERN? Agro

                  Maybe you could get an array of column names using NAME and filter out the
                  ones you want with perl.

                  NAME
                  Returns a reference to an array of column names. Example:
                  $names = $sth->{NAME};


                  For instance, I use this to get the col names:

                  foreach $n (@{$sth->{NAME}}){
                  print "NAME: $n\n";
                  }



                  "Martin Laflamme" <courses@market bridge.com.no.s pam.now> wrote in message
                  news:4044b74f.9 8168765@news.is top.com...[color=blue]
                  >
                  > To: Aggro
                  >
                  > I'm actually using PERL! I should use PHP but I don't have time to
                  > learn a new language. I'm thinking about what you said and the table
                  > structure. I think you've got some thing there.
                  >
                  > I cant use select * because there's other columns with other names
                  >
                  > Martin
                  >
                  > On Sun, 29 Feb 2004 15:55:41 GMT, Martin@marketbr idge.com.no.spa m.now
                  > wrote:
                  >[color=green]
                  > >Hi there,
                  > >
                  > >I've been looking far and wide on this one. I'm looking for a way to
                  > >select from columns where the columns have a certain pattern!
                  > >
                  > >Example:
                  > >
                  > >Instead of doing:
                  > >
                  > >SELECT q1, q2, q3, q4, q5, q6, q7, q8, q9 FROM exam
                  > >
                  > >I would like to do:
                  > >
                  > >SELECT q* FROM exam
                  > >
                  > >or
                  > >
                  > >SELECT q% FROM exam
                  > >
                  > >Whatever will match everything that has the letter q in it. Anyone
                  > >have an idea? I've been banging my head on this one.
                  > >
                  > >Martin
                  > > p.s. I would appreciate an e-mail as well if you replay
                  > >
                  > >martin@marketb ridge.com.no.sp amed[/color]
                  >[/color]


                  Comment

                  • Jay

                    #10
                    Re: How do I SELECT FROM columns where the COLUMNS has a PATTERN? Agro

                    Maybe you could get an array of column names using NAME and filter out the
                    ones you want with perl.

                    NAME
                    Returns a reference to an array of column names. Example:
                    $names = $sth->{NAME};


                    For instance, I use this to get the col names:

                    foreach $n (@{$sth->{NAME}}){
                    print "NAME: $n\n";
                    }



                    "Martin Laflamme" <courses@market bridge.com.no.s pam.now> wrote in message
                    news:4044b74f.9 8168765@news.is top.com...[color=blue]
                    >
                    > To: Aggro
                    >
                    > I'm actually using PERL! I should use PHP but I don't have time to
                    > learn a new language. I'm thinking about what you said and the table
                    > structure. I think you've got some thing there.
                    >
                    > I cant use select * because there's other columns with other names
                    >
                    > Martin
                    >
                    > On Sun, 29 Feb 2004 15:55:41 GMT, Martin@marketbr idge.com.no.spa m.now
                    > wrote:
                    >[color=green]
                    > >Hi there,
                    > >
                    > >I've been looking far and wide on this one. I'm looking for a way to
                    > >select from columns where the columns have a certain pattern!
                    > >
                    > >Example:
                    > >
                    > >Instead of doing:
                    > >
                    > >SELECT q1, q2, q3, q4, q5, q6, q7, q8, q9 FROM exam
                    > >
                    > >I would like to do:
                    > >
                    > >SELECT q* FROM exam
                    > >
                    > >or
                    > >
                    > >SELECT q% FROM exam
                    > >
                    > >Whatever will match everything that has the letter q in it. Anyone
                    > >have an idea? I've been banging my head on this one.
                    > >
                    > >Martin
                    > > p.s. I would appreciate an e-mail as well if you replay
                    > >
                    > >martin@marketb ridge.com.no.sp amed[/color]
                    >[/color]


                    Comment

                    Working...