Tough query to crack

2006-06-28 Thread Orton, Steve
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

Re: Tough query to crack

2006-06-28 Thread Peter Brawley
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

RE: Tough query to crack

2006-06-28 Thread Orton, Steve
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

Re: Tough query to crack

2006-06-28 Thread Peter Brawley
]] 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

RE: Tough query to crack

2006-06-28 Thread Orton, Steve
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

Re: Tough query to crack

2006-06-28 Thread Peter Brawley
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

Tough Query Problem

2004-06-16 Thread Aaron Clausen
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

Re: Tough Query Problem

2004-06-16 Thread Dan Nelson
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

Re: Tough Query Problem

2004-06-16 Thread A. Clausen
- 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

Tough Query for this New DBA

2004-03-21 Thread Duke, Brian
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

Re: Tough Query for this New DBA

2004-03-21 Thread Martijn Tonies
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

Re: Tough Query for this New DBA

2004-03-21 Thread Peter Brawley
=#; ? 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

Re: Help with a tough query

2004-03-16 Thread Brent Baisley
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.

Re: Help with a tough query

2004-03-16 Thread Brent Baisley
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

Help with a tough query

2004-03-15 Thread Brent Baisley
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

Re: Help with a tough query

2004-03-15 Thread Rhino
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

Re: Help with a tough query

2004-03-15 Thread Brent Baisley
: 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

Re: Help with a tough query

2004-03-15 Thread Peter Brawley
- 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

a tough(?) query problem

2002-03-24 Thread [EMAIL PROTECTED]
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

very tough query

2002-03-05 Thread Daren Cotter
ok, here are the 3 tables i have that are related: mysql desc poll_questions; ++-+--+-++-- --+ | Field | Type| Null | Key | Default| Extra |

Re: very tough query

2002-03-05 Thread Batara Kesuma
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 |

RE: very tough query

2002-03-05 Thread Daren Cotter
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

Re: very tough query

2002-03-05 Thread Rodney Broom
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

Re: very tough query

2002-03-05 Thread Nathan
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

tough query

2001-08-30 Thread Daren Cotter
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

Re: tough query

2001-08-30 Thread Paul DuBois
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

tough query

2001-06-30 Thread Daren Cotter
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

Re: tough query

2001-06-30 Thread Werner Stuerenburg
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