Hello fellow listers,
I'm currently trying to reduce our TCO by incorporating this fine DBMS and
replacing the MS SQLServer we're using. I'm trying to re-implement the stored
procedures written for SQLServer to MySQL and have one that's tough to figure
out.
This stored procedure
Steve,
INSERT INTO master_context_list (Context_ID, Target_ID)
SELECT Context_ID = @ContextID, targets_list.Target_ID FROM
targets_list
WHERE Target_ID IN ( SELECT Target_ID FROM #APPLICABLE_TARGET_IDS )
[EMAIL PROTECTED] tells the server to return 1 when the column value
of
into the APPLICABLE_TARGET_IDS temporary table.
steve---
Steven J Orton
Software Engineer
Northrop Grumman Mission Systems
Middletown, RI 02842
-Original Message-
From: Peter Brawley [mailto:[EMAIL PROTECTED]
Sent: Wed 6/28/2006 4:01 PM
To: Orton, Steve
Cc: mysql@lists.mysql.com
Subject: Re: Tough query to crack
]]
Sent: Wed 6/28/2006 4:01 PM
To: Orton, Steve
Cc: mysql@lists.mysql.com
Subject: Re: Tough query to crack
Steve,
INSERT INTO master_context_list (Context_ID, Target_ID)
SELECT Context_ID = @ContextID, targets_list.Target_ID FROM
targets_list
WHERE Target_ID IN ( SELECT Target_ID FROM
Middletown, RI 02842
-Original Message-
From: Peter Brawley [mailto:[EMAIL PROTECTED]
Sent: Wed 6/28/2006 4:57 PM
To: Orton, Steve; mysql@lists.mysql.com
Subject: Re: Tough query to crack
/I don't think that will work because Context_ID is not found in
'targets_list' hence the error
at SQL statements as a whole:)
Steven J Orton
Software Engineer
Northrop Grumman Mission Systems
Middletown, RI 02842
-Original Message-
From: Peter Brawley [mailto:[EMAIL PROTECTED]]
Sent: Wed 6/28/2006 4:57 PM
To: Orton, Steve; mysql@lists.mysql.com
Subject: Re: Tough query to crack
/I
I am trying to write a script that can take logs from our mail server, boil down the
rejections to determine the sources of distributed SMTP dictionary attacks against our
mail server.
Basically I have a table send_failures like this that gets fed with the raw data from
the logs:
host_ip
In the last episode (Jun 16), Aaron Clausen said:
I am trying to write a script that can take logs from our mail
server, boil down the rejections to determine the sources of
distributed SMTP dictionary attacks against our mail server.
Basically I have a table send_failures like this that
- Original Message -
From: Dan Nelson [EMAIL PROTECTED]
To: Aaron Clausen [EMAIL PROTECTED]
Cc: MySQL Mailing List [EMAIL PROTECTED]
Sent: Wednesday, June 16, 2004 10:20
Subject: Re: Tough Query Problem
In the last episode (Jun 16), Aaron Clausen said:
I am trying to write a script
There has got to be a better way for me to query/subquery this data.
I have 4 tables.
Table1
-
Company_Name | Company_ID
-
Blue Shoe| 101
Fast Cow | 102
Table2
Hi Brian,
Not answering your question, but are your table names
really table1, table2 etc?
If so, you will be running into more problems :-)
With regards,
Martijn Tonies
Database Workbench - developer tool for InterBase, Firebird, MySQL MS SQL
Server.
Upscene Productions
=#;
?
PB
- Original Message -
From: Duke, Brian
To: [EMAIL PROTECTED]
Sent: Sunday, March 21, 2004 3:16 AM
Subject: Tough Query for this New DBA
There has got to be a better way for me to query/subquery this data.
I have 4 tables.
Table1
The DISTINCT key word works on the whole record, not the field that
follows it. So the query actually does return multiple records with the
same EventID when there are multiple related contacts/regardings.
DISTINCT filters out duplicate records created from the joining of the
three tables.
Egads you're right! I've been overthinking this. There must something
else wrong in my query.
Thanks for the hit over the head. I needed it.
On Mar 16, 2004, at 10:37 AM, Harald Fuchs wrote:
When you specify a left join, you will always get the same number of
records as are in your primary
I didn't think this was too hard when I first created it, but now that
I'm loading test data it's not working as expected.
The core of the query is three tables: Event, Contact, and Regarding.
There can be zero or more Contacts for each event and zero or more
Regardings for each event. There
Remarks interspersed below.
Rhino
- Original Message -
From: Brent Baisley [EMAIL PROTECTED]
To: MYSQL list [EMAIL PROTECTED]
Sent: Monday, March 15, 2004 4:32 PM
Subject: Help with a tough query
I didn't think this was too hard when I first created it, but now that
I'm loading test
:
Remarks interspersed below.
Rhino
- Original Message -
From: Brent Baisley [EMAIL PROTECTED]
To: MYSQL list [EMAIL PROTECTED]
Sent: Monday, March 15, 2004 4:32 PM
Subject: Help with a tough query
I didn't think this was too hard when I first created it, but now that
I'm loading test
-
From: Brent Baisley
To: MYSQL list
Sent: Monday, March 15, 2004 3:32 PM
Subject: Help with a tough query
I didn't think this was too hard when I first created it, but now that
I'm loading test data it's not working as expected.
The core of the query is three tables: Event, Contact
hi
I need to select the ten latest entries from a diary-database, but i don't want
to get any duplicate users, so if i want to select the ten latest entries and
someone has written five entries of these latest ones, i only want to get the
latest entries from each user. So far no problem, my
ok, here are the 3 tables i have that are related:
mysql desc poll_questions;
++-+--+-++--
--+
| Field | Type| Null | Key | Default| Extra
|
Hi Darren,
On Tue, 5 Mar 2002 09:42:50 -0800
Daren Cotter [EMAIL PROTECTED] wrote:
mysql desc poll_questions;
++-+--+-++-
---+
| Field | Type| Null | Key | Default| Extra
|
To: [EMAIL PROTECTED]
Cc: Daren Cotter
Subject: Re: very tough query
Hi Darren,
On Tue, 5 Mar 2002 09:42:50 -0800
Daren Cotter [EMAIL PROTECTED] wrote:
mysql desc poll_questions;
++-+--+-++-
---+
| Field | Type
From: Daren Cotter [EMAIL PROTECTED]
...what happens when I want to delete a poll?
Do it machanically. That is, do a query in advance to find the data that needs to be
deleted, then go through and delete it. The logic for joining a delete can be written,
but MySQL doesn't support it. (Hey
PM
Subject: RE: very tough query
Here's what happens:
ERROR 1064: You have an error in your SQL syntax near ' poll_answers,
poll_votes where (poll_questions.poll_id = poll_answers.poll_id) ' at line 1
-Original Message-
From: Nathan [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 05
i have a query that needs to do the following:
in my members table, i store the member id, and the referer id of the member
that referred them (the referer_id links to the member_id).
for example, a member signs up and gets the id of 0200289, and was referred
by 0001008. anyway, over time, when
At 6:10 PM -0700 8/30/01, Daren Cotter wrote:
i have a query that needs to do the following:
in my members table, i store the member id, and the referer id of the member
that referred them (the referer_id links to the member_id).
for example, a member signs up and gets the id of 0200289, and
i have 3 tables: offers, rewards, and sources. sources has just a source
name and source id. both the offers and rewards tables have a source_id
field which relates to the sources table. i need to write a query that
selects the source name and the count in each table with that source id. is
this
i have 3 tables: offers, rewards, and sources. sources has just a source
name and source id. both the offers and rewards tables have a source_id
field which relates to the sources table. i need to write a query that
selects the source name and the count in each table with that source id. is
28 matches
Mail list logo