Re: MySQL statement with REGEX / RLIKE containing a scalar variable possible?

2008-11-16 Thread Wolf
On Nov 13, 4:56 pm, [EMAIL PROTECTED] (Deviloper) wrote: > I have a SQL-Statement with a Regular Expression and I want to use a scalar > in that expression: (Looking for something like "$tool =~ m/\Q$x\E/" ) > > #Find tools with xx in the name: > $dbh->prepare ("SELECT name FROM toolbox WHERE

MySQL statement with REGEX / RLIKE containing a scalar variable possible?

2008-11-13 Thread Deviloper
I have a SQL-Statement with a Regular Expression and I want to use a scalar in that expression: (Looking for something like "$tool =~ m/\Q$x\E/" ) #Find tools with xx in the name: $dbh->prepare ("SELECT name FROM toolbox WHERE name REGEX '$x'"); #or $dbh->prepare ("SELECT name FROM toolbox

Fwd: Mysql Statement

2003-07-09 Thread Barry C . Hawkins
This question should go to: http://lists.mysql.com/list.php?list=mysql#b You can try this in MySQL: SELECT company, date, SUM(sales) AS `totalsales`, SUM(cost) AS `totalcost` FROM tablename GROUP BY company, date ORDER BY company, date On Wednesday, Jul 9, 2003, at 13:59 US/Eastern, Paul Kraus

RE: Mysql Statement

2003-07-09 Thread Bob Showalter
Paul Kraus wrote: > This probably is not the place for this post. But it is in a perl > application so I thought I would check with you guys first. > > I have to query a mysql database (using DBI) > > It has records like this > > Date|company|sales|cost > > Each date has two records on for each

Mysql Statement

2003-07-09 Thread Paul Kraus
This probably is not the place for this post. But it is in a perl application so I thought I would check with you guys first. I have to query a mysql database (using DBI) It has records like this Date|company|sales|cost Each date has two records on for each of the two companies we deal