Thanks for the tip. I am looking at just making 16 separate queries.
It will be easier to manage and faster to run.
Dan
On Sep 6, 2008, at 9:37 PM, Brent Baisley <[EMAIL PROTECTED]> wrote:
Well, for your simple example, you can use query variables to add
the "counters".
SET @cntr:=0, @last
Well, for your simple example, you can use query variables to add the
"counters".
SET @cntr:=0, @lastVal:='A'
INSERT INTO tableB LOC,DATA SELECT CONCAT(LOC,
CONCAT( IF(@lastVal=LOC, @cntr:[EMAIL PROTECTED], @cntr:=0),
IF(@lastVal:=LOC,'',''))) LOC, CONCAT(DATA, @cntr) FROM tableA ORDER
BY
I have an existing data set - here is an example (the real one is more
complex than this)
LOC DATA
-
A 1
B 2
C 3
D 4
E 5
F 6
...
and I am looking to run some sort of INSERT ... SELECT on this to make
a new table like this:
LOC DATA
anced SELECT Syntax Help Needed!
On Fri, 5 Nov 2004 17:49:29 -0500, Rhino <[EMAIL PROTECTED]> wrote:
> I'm not sure why you want to use a subquery; if MySQL is anything like
DB2,
> a join usually performs better than a subquery and the optimizer converts
a
> subquery to
On Fri, 5 Nov 2004 17:49:29 -0500, Rhino <[EMAIL PROTECTED]> wrote:
> I'm not sure why you want to use a subquery; if MySQL is anything like DB2,
> a join usually performs better than a subquery and the optimizer converts a
> subquery to a join ("under the covers") whenever it can anyway. Therefore
linkname2
from main m right outer join links1 l1 on m.id = l1.id
right outer join links l2 on m.id = l2.id;
I haven't tested it but it ought to work.
Rhino
- Original Message -
From: "Monique" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November
Hi!
I would love some help with my syntax (or another strategy). I keep bombing.
I've simplified it. Here is the deal:
Three files:
Main: id, name
Links1: id, linkname1 (a record may or may not exist for each record in
Main)
Links2: id, linkname2 (a record may or may not exist for each re
Hi!
On Sep 07, Sebastian Hoffmann wrote:
> Hello,
>
> I have just updated from MySQL 3.23 to MySQL 4.0.14. My operating
> system is Mac OS X (10.2.6).
>
> I have now encountered an odd problem with some "select" statements
> which appear to work differently in the new version:
>
> I want to d
Sebastian Hoffmann <[EMAIL PROTECTED]> wrote:
>
> I have just updated from MySQL 3.23 to MySQL 4.0.14. My operating
> system is Mac OS X (10.2.6).
>
> I have now encountered an odd problem with some "select" statements
> which appear to work differently in the new version:
>
> I want to do a j
Hello,
I have just updated from MySQL 3.23 to MySQL 4.0.14. My operating
system is Mac OS X (10.2.6).
I have now encountered an odd problem with some "select" statements
which appear to work differently in the new version:
I want to do a join on two tables which are in two different
databases
Hello All,
What syntax for MySQL should I be looking at to solve a problem like
the following:
3 Tables (oversimplified to show the problem area)
individual.id
individual.name
individual_addresses.individual_id
individual_addresses.address_id
address.id
address.street
Although the structure is
On 8 Jan 2003, at 15:27, Svens Klave wrote:
> | image | check |
> | 6782 | 0 |
> | 2732 | 1 |
> | 6734 | 1 |
>
> so I want to make query
> select * from foo1 where [so is it possible to make some if check=1 then
> image is image but if check=0 then into image goes othe
On Wed, Jan 08, 2003 at 03:27:51PM +0200, Svens Klave wrote:
>
> Can anybody help me
> with select query
>
> how to do this:
>
> I have table "foo1" with two fields "image" "check"
>
> | image | check |
> | 6782 | 0 |
> | 2732 | 1 |
> | 6734 | 1 |
>
> so I want to ma
* Svens Klave
> Can anybody help me
> with select query
I can try.
> how to do this:
>
> I have table "foo1" with two fields "image" "check"
>
> | image | check |
> | 6782 | 0 |
> | 2732 | 1 |
> | 6734 | 1 |
>
> so I want to make query
> select * from foo1 where [so is
You don't even need the "check" field you can just directly check the
contents of the image field. Although I'm not sure if you are trying to
set a filter or display something different. If you want to display a
conditional on a field then you need to specify that field directly.
select *,if(im
Can anybody help me
with select query
how to do this:
I have table "foo1" with two fields "image" "check"
| image | check |
| 6782 | 0 |
| 2732 | 1 |
| 6734 | 1 |
so I want to make query
select * from foo1 where [so is it possible to make some if check=1 then
image
-
> From: "Mark Rowlands" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, May 17, 2001 3:11
> Subject: create table with select syntax error problem
>
> > CREATE TABLE Ftt (sajtid smallint(6) DEFAULT '0' NOT NULL,count int(10)
&
Original Message -
From: "Mark Rowlands" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 17, 2001 3:11
Subject: create table with select syntax error problem
> CREATE TABLE Ftt (sajtid smallint(6) DEFAULT '0' NOT NULL,count int(
CREATE TABLE Ftt (sajtid smallint(6) DEFAULT '0' NOT NULL,count int(10)
unsigned DEFAULT '0' NOT NULL,PRIMARY KEY (sajtid)) select
log.sajtid,count(*) from log,sajter where log.sajtid=sajter.id and log.mon =
5 group by log.sajtid;
the create table on its own works, the select statement works,
I have a (dumb!) program that performs SELECT statements with a quote around
the table and the fieldname; see the portion from the trace log below:
Cardfivefffe35e1:fffed875 EXIT SQLExecDirect with return code -1
(SQL_ERROR)
HSTMT 0x00cf17ac
UCHAR * 0x00ae6
"Thalis A. Kalfigopoulos" wrote:
> Check you don't have empty strings as empty remarks, but that you have NULLs.
> Even with empty strings as remarks though you can bypass them with an extra WHERE
>condition :-)
That was it. I was storing empty strings, instead of NULLs. Thanks!
AMK4
On Thu, 5 Apr 2001, Ashley M. Kirchner wrote:
> "Thalis A. Kalfigopoulos" wrote:
>
> > > +--++--+-+
> > > | task | comment |remarks | history |
> > > +--++--+-+
> > > | task_1 | cmt_1
"Thalis A. Kalfigopoulos" wrote:
> > +--++--+-+
> > | task | comment |remarks | history |
> > +--++--+-+
> > | task_1 | cmt_1| rmk_1| |
> > | task_1 | cmt_2
On Wed, 4 Apr 2001, Ashley M. Kirchner wrote:
>
> Db -> table1, table2 and table3
>
> SELECT table1.task, table2.comment, table2.remarks, table3.history
> FROM table1 LEFT JOIN table2 ON table1.id=table2.todoid
> LEFT JOIN table3 ON table1.id=table3.todoid WHERE table1.id=10;
>
> Resul
Db -> table1, table2 and table3
SELECT table1.task, table2.comment, table2.remarks, table3.history
FROM table1 LEFT JOIN table2 ON table1.id=table2.todoid
LEFT JOIN table3 ON table1.id=table3.todoid WHERE table1.id=10;
Results (roughly) in:
+--++--+-
Db -> table1, table2 and table3
SELECT table1.task, table2.comment, table2.remarks, table3.history
FROM table1 LEFT JOIN table2 ON table1.id=table2.todoid
LEFT JOIN table3 ON table1.id=table3.todoid WHERE table1.id=10;
Results (roughly) in:
+--++--+-
26 matches
Mail list logo