467,925 Members | 1,912 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 467,925 developers. It's quick & easy.

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

ma****@marketbridge.com.no.spamed
Jul 19 '05 #1
  • viewed: 1569
Share:
9 Replies
Ma****@marketbridge.com.no.spam.now wrote:
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

ma****@marketbridge.com.no.spamed


what about eval() function? If we mean PHP.
Jul 19 '05 #2
Ma****@marketbridge.com.no.spam.now wrote:
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

ma****@marketbridge.com.no.spamed


what about eval() function? If we mean PHP.
Jul 19 '05 #3
Ma****@marketbridge.com.no.spam.now wrote:
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

ma****@marketbridge.com.no.spamed


what about eval() function? If we mean PHP.
Jul 19 '05 #4

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, Ma****@marketbridge.com.no.spam.now
wrote:
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

ma****@marketbridge.com.no.spamed


Jul 19 '05 #5

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, Ma****@marketbridge.com.no.spam.now
wrote:
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

ma****@marketbridge.com.no.spamed


Jul 19 '05 #6

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, Ma****@marketbridge.com.no.spam.now
wrote:
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

ma****@marketbridge.com.no.spamed


Jul 19 '05 #7
Jay
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" <co*****@marketbridge.com.no.spam.now> wrote in message
news:40***************@news.istop.com...

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, Ma****@marketbridge.com.no.spam.now
wrote:
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

ma****@marketbridge.com.no.spamed

Jul 19 '05 #8
Jay
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" <co*****@marketbridge.com.no.spam.now> wrote in message
news:40***************@news.istop.com...

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, Ma****@marketbridge.com.no.spam.now
wrote:
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

ma****@marketbridge.com.no.spamed

Jul 19 '05 #9
Jay
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" <co*****@marketbridge.com.no.spam.now> wrote in message
news:40***************@news.istop.com...

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, Ma****@marketbridge.com.no.spam.now
wrote:
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

ma****@marketbridge.com.no.spamed

Jul 19 '05 #10

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by David Nedrow | last post: by
2 posts views Thread by bettina | last post: by
2 posts views Thread by Vagabond Software | last post: by
reply views Thread by Vagabond Software | last post: by
3 posts views Thread by CharlesA | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.