Efficient use of sub queries?

2011-07-15 Thread J B
I was wondering if any one could point out potential problems with the following query or if there was a better alternative From a list of users I want to return all who don't have all the specified user_profile options or those who do not have at least one preference set to 1. The following

I don¹t have sub queries, can someone suggest alternatives

2006-08-08 Thread Scott Haneda
DELETE from cart WHERE product_id NOT IN( SELECT id FROM products where status = 'enabled') AND user_id = '90' The above is what I would like it to do, though I can not test it as I do not have access to a mysql that supports it. Aside from two queries, can someone perhaps show me how to run

Re: I don¹t have sub queries, can someone suggest alternatives

2006-08-08 Thread Scott Haneda
DELETE from cart WHERE product_id NOT IN( SELECT id FROM products where status = 'enabled') AND user_id = '90' The above is what I would like it to do, though I can not test it as I do not have access to a mysql that supports it. Aside from two queries, can someone perhaps show me how

Problems getting MySqlDump to use sub-queries

2006-02-15 Thread Henry Dall
the where portion of the command correctly (though I have tried every possible wrapping with single-quotes that I could come up with) OR are sub-queries simply not supported OR is there something else that I should know. Any help you can give me would be way appreciated. Henry Dall [EMAIL

RE: Problems getting MySqlDump to use sub-queries

2006-02-15 Thread George Law
getting MySqlDump to use sub-queries I am having a problem using MySqlDump. Context: I am having to export some very specific records from our database We have a table called BIN which has, amongst others, an ID column and an ACCOUNT_ID column. When I use this mysqldump -u

Re: Issue with AS and sub queries

2005-07-10 Thread Gleb Paharenko
Hello. Please can you send the complete query and table definition, because I was unable to reproduce this weird behavior. What version of MySQL do you use? What client do you use to execute queries? We can see below, that there is no period before total_bandwidth: mysql select (SELECT

Issue with AS and sub queries

2005-07-07 Thread Dan Rossi
Hi there somehow my AS field alias of a sub query is adding a dot at the start therefore I cant use it in my application. (SELECT SUM(feed_usage.bandwidth) AS bandwidth FROM feed_usage WHERE customerID IN (57) AND DATE_FORMAT(feed_usage.stats_date,'%m%Y')=DATE_FORMAT(NOW(),'%m%Y') ) AS

sub queries

2004-10-29 Thread Nathan Coast
Hi apologies if this is a dumb question but can you do subqueries in mysql? select count(*) as RES from ACL_USER_GROUP_ROLE as UGR where UGR.USER_ID =2 and UGR.ROLE_ID = (select ROLE_ID from ACL_ROLE where ROLE_NAME = 'projectmanager' ) this query fails, but the individual queries work fine

Re: sub queries

2004-10-29 Thread Wolfram Kraus
Nathan Coast wrote: Hi apologies if this is a dumb question but can you do subqueries in mysql? select count(*) as RES from ACL_USER_GROUP_ROLE as UGR where UGR.USER_ID =2 and UGR.ROLE_ID = (select ROLE_ID from ACL_ROLE where ROLE_NAME = 'projectmanager' ) this query fails, but the

Re: sub queries

2004-10-29 Thread Matthew Scales
Hi Nathan, Subqueries are only available in MySQL as of version 4.1. On Fri, 29 Oct 2004, Nathan Coast wrote: Hi apologies if this is a dumb question but can you do subqueries in mysql? select count(*) as RES from ACL_USER_GROUP_ROLE as UGR where UGR.USER_ID =2 and UGR.ROLE_ID = (select

Sub queries

2004-10-28 Thread electroteque
Hi there, I have Mysql 4.1 on my development machine, I have been trying to test out if I am going to be able to do this. What I would like to do is return a one to many resultset but without the duplicated results in the first query. Hows is this going to be possible ? I would like to get all

Re: Sub queries

2004-10-28 Thread Rhino
- Original Message - From: electroteque [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 28, 2004 6:33 PM Subject: Sub queries Hi there, I have Mysql 4.1 on my development machine, I have been trying to test out if I am going to be able to do this. What I would like

Re: Sub queries

2004-10-28 Thread Mat Scales
electroteque wrote: Also I am trying to push for 4.1 to be installed on the servers i build web apps on. When will be a possible date to say that gamma which is practically production quality, to actually say production quality ? heheh. Our systems guy will only trust it if it says that, god

Re: Sub queries

2004-10-28 Thread daniel
The keyword UNION should ensure that all duplicate rows are removed from the combined result set. If you use UNION ALL instead of UNION, the duplicates are left in the result set. Yeh right, funny, early versions of 4.0, UNION had in the docs this was only avail in 4.1, i am so sure i read

Re: Sub queries

2004-10-28 Thread Rhino
- Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, October 28, 2004 9:26 PM Subject: Re: Sub queries The keyword UNION should ensure that all duplicate rows are removed from the combined result set. If you use UNION ALL instead of UNION

Re: Sub queries

2004-10-28 Thread daniel
There are obviously many possible variations of your query; I just stated one that was pretty close to your original query. It's really not clear to me yet what you were trying to do so I just wanted to show you typical syntax. Ok sorry ppl I should have given a typical example in my

Sub Queries in MYSQL and JOINS

2004-07-08 Thread James Raff
I have MYSQL 3.23.32 on a Cobalt 550 platform. I see from the FAQ's that sub queries will not work on MYSQL 4.1. Is there a way to use JOIN statements instead or do these fail too. eg: SELECT some_ID from someTable NOT IN (Select some_ID from ANOTHERTABLE) Or do I have to redesign my website

Re: Sub Queries in MYSQL and JOINS

2004-07-08 Thread Michael Stassen
James Raff wrote: I have MYSQL 3.23.32 on a Cobalt 550 platform. I see from the FAQ's that sub That's a *very* old version. The latest 3.23 is 3.23.58. The current production release is 4.0.20. You should consider upgrading. queries will not work on MYSQL 4.1. Is there a way to use JOIN

Regd Sub Queries

2003-12-18 Thread Sandeep N Seshadri
hello every one, i am in the process of converting my database from access to mysql ... now tat i have started working with mysql i have realized that my subqueries wont work here ... i read the article on how to handle some of the simple subqueries with joins ... my subquery is as follow and i

Re: Regd Sub Queries

2003-12-18 Thread Daniel Kasak
Sandeep N Seshadri wrote: hello every one, i am in the process of converting my database from access to mysql ... now tat i have started working with mysql i have realized that my subqueries wont work here ... i read the article on how to handle some of the simple subqueries with joins ... my

Regd Sub Queries

2003-12-18 Thread Sandeep N Seshadri
Could you please tell me more about the pass through queries. i dont have an idea abt it sandeep -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: Regd Sub Queries

2003-12-18 Thread Daniel Kasak
Sandeep N Seshadri wrote: Could you please tell me more about the pass through queries. i dont have an idea abt it sandeep Sure. Create a new query in Access. Instead of adding tables to the query design view like normal, simply click the 'query' menu, and select 'SQL Specific', and then

Re: sub queries in mysql?

2003-08-14 Thread Roger Baklund
* Jasper Bijl Is there a way to do something like subqueries in one query? Yes, JOIN can be used in many cases where you would think you need sub-queries. A JOIN is also generally faster, according to: URL: http://www.mysql.com/doc/en/ANSI_diff_Subqueries.html I have a customer table (Klant

sub queries in mysql?

2003-08-14 Thread Jasper Bijl
Hello, Is there a way to do something like subqueries in one query? I have a customer table (Klant) with contacts (KlantKontakt) and a address (Adres) table. The address table keeps a record of each different address for a customer including old addresses (to maintain history). If I want to

RE: sub queries in mysql?

2003-08-14 Thread Jasper Bijl
PROTECTED] Sent: woensdag 13 augustus 2003 13:40 To: [EMAIL PROTECTED] Cc: Jasper Bijl Subject: Re: sub queries in mysql? * Jasper Bijl Is there a way to do something like subqueries in one query? Yes, JOIN can be used in many cases where you would think you need sub-queries. A JOIN

Re: sub-queries

2002-06-07 Thread Benjamin Pflugmann
what the query does, I'll appreciate it allot. It may help me understand the basic logic behind the structure of the query, and aid me in the future when I may need to execute such queries again (although, I'm honestly hoping that when such a time comes, MySQL will support sub-queries). Okay

sub-queries

2002-06-06 Thread Chris Knipe
Lo all, are sub-queries supported on mysql-max 3.23.49 ?? If they are, what's wrong with the following statement? SELECT monitorhosts.HostID FROM monitorhosts WHERE monitorhosts.HostID NOT IN (SELECT HostID FROM monitorhostgroupdetails WHERE

Re: sub-queries

2002-06-06 Thread Kiss Dániel
I'm sorry to disappoint you, but subqueries are NOT supported int any MySQL version, yet. You can read the MySQL manual about it. You can find there when and how it will be implemented. Bye Daniel At 21:39 2002.06.06. +0200, you wrote: Lo all, are sub-queries supported on mysql-max

Re: sub-queries

2002-06-06 Thread Chris Knipe
Dániel [EMAIL PROTECTED] To: Chris Knipe [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Thursday, June 06, 2002 9:47 PM Subject: Re: sub-queries I'm sorry to disappoint you, but subqueries are NOT supported int any MySQL version, yet. You can read the MySQL manual about it. You can find there when

Re: sub-queries

2002-06-06 Thread Sabine Richter
SELECT monitorhosts.HostID FROM monitorhosts, monitorhostgroupdetails WHERE monitorhosts.HostID = monitorhostgroupdetails.HostID AND monitorhostgroupdetails.HostGroupID != '1'); Gruss Sabine Chris Knipe wrote: Lo all, are sub-queries supported on mysql-max 3.23.49

RE: sub-queries

2002-06-06 Thread Cal Evans
- From: Chris Knipe [mailto:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 2:52 PM To: [EMAIL PROTECTED] Subject: Re: sub-queries Fair enough (and also what I thought) Does anyone have any idea how I can implement the below in a similar fashion then? I have a list of items, and a list

Re: sub-queries

2002-06-06 Thread Chris Knipe
Subject: Re: sub-queries SELECT monitorhosts.HostID FROM monitorhosts, monitorhostgroupdetails WHERE monitorhosts.HostID = monitorhostgroupdetails.HostID AND monitorhostgroupdetails.HostGroupID != '1'); Gruss Sabine Chris Knipe wrote: Lo all, are sub-queries supported on mysql-max

Re: sub-queries

2002-06-06 Thread Chris Knipe
to have to use PHP arrays and compare arrays with hundreds of thousands of values in them?? *deep sigh* - Original Message - From: Chris Knipe [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, June 06, 2002 10:16 PM Subject: Re: sub-queries *MWAH*!!! Thanks a million

RE: sub-queries

2002-06-06 Thread Kevin Fries
:[EMAIL PROTECTED]] Sent: Thursday, June 06, 2002 1:52 PM To: [EMAIL PROTECTED] Subject: Re: sub-queries Ok, I spoke to soon... And this is starting to drive me up the walls now... i.e. getting REALLY irritating and frustrating. mysql DESCRIBE monitorhosts

Re: sub-queries

2002-06-06 Thread Chris Knipe
- Original Message - From: Kevin Fries [EMAIL PROTECTED] To: 'Chris Knipe' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, June 07, 2002 12:38 AM Subject: RE: sub-queries Chris, sounds like you're looking for an exclusive left outer join. You want to see records from

Re: sub-queries

2002-06-06 Thread Benjamin Pflugmann
Hi. On Fri 2002-06-07 at 01:55:18 +0200, [EMAIL PROTECTED] wrote: [...] Chris, sounds like you're looking for an exclusive left outer join. You want to see records from monitorhosts, where there is no corresponding record in monitorhostgroupdetails, right? Yes - and no. If a

Re: sub-queries

2002-06-06 Thread Chris Knipe
also have to admit... It was pointed out to me about two days ago that I would need to execute this query with a LEFT JOIN. Coming from a MSSQL background, and being used to simply using sub-queries, I did go and read the section in the manual about LEFT / RIGHT JOIN statements. After reading about

ETA for MySql having sub queries capabilities

2002-03-08 Thread Rolando Morales
Does anyone know the ETA for MySql having sub queries capabilities? Rolando - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com

Re: update support sub-queries?

2001-09-30 Thread Benjamin Pflugmann
Hi. With MySQL, there is not (yet) a way to do this with a single command. A poor SQL work-around is possible, but a bit bloated. On the other hand, ta.f1 is a redundand field (regarding tb.af1) and therefore you normally would seldom need a command such as the one below. One (quite probably

update support sub-queries?

2001-09-29 Thread can
Hi all, I am new in mysql and want to analyse between some popular databases. I have a SQL: update ta set f1 = ( select af1 from tb where ta.id = tb.id ); It can be done in postgreSQL and Oracle. How can I do the same tasks in MySQL without using Perl? Is it possible to do this tasks just

RE: update support sub-queries?

2001-09-29 Thread Daniel Ouellet
At the moment, according to the doc: http://www.mysql.com/documentation/mysql/bychapter/manual_Introduction.html# Missing_Sub-selects MySQL only support the insert select and Replace Select. I am not sure if that answer your question as I am not a big guru on it either, but it is a place to

Re: Does MySQL support sub queries ?

2001-04-16 Thread Gerald Clark
To: Yen Cc: [EMAIL PROTECTED] Subject: Re: Does MySQL support sub queries ? On Fri, Apr 13, 2001 at 04:02:31PM +0800, Yen wrote: Does anyone know whether this MySQL support sub queries? Anyone who has checked the MySQL Manual does. (Hint: http://www.mysql.com/doc/M/i/Missing_Sub

RE: Does MySQL support sub queries ?

2001-04-15 Thread Yen
Thank you Jeremy, these really help!! I can't find the manual :D -Original Message- From: Jeremy Zawodny [mailto:[EMAIL PROTECTED]] Sent: Friday, April 13, 2001 4:00 PM To: Yen Cc: [EMAIL PROTECTED] Subject: Re: Does MySQL support sub queries ? On Fri, Apr 13, 2001 at 04:02:31PM +0800

Re: Does MySQL support sub queries ?

2001-04-14 Thread Clifford Bradbury
Well I have managed to rewrite alot of my coding from MS SQL in a downward and more portable style using MySQL and ASP. I too have now hit apon where I need to have Sub queries on some basic searching of products. Rather than just telling people "the manual says..." that Sub Selects a

Does MySQL support sub queries ?

2001-04-13 Thread Yen
Hi, Does anyone know whether this MySQL support sub queries? such as: select ref from tool1 where detail = 'xxx' and ref in (select ref from tool1 where detail='yyy'); No matter it's within the same table or different table. However below is the error I've got, anyone can help? ERROR 1064

Re: Does MySQL support sub queries ?

2001-04-13 Thread Jeremy Zawodny
On Fri, Apr 13, 2001 at 04:02:31PM +0800, Yen wrote: Does anyone know whether this MySQL support sub queries? Anyone who has checked the MySQL Manual does. (Hint: http://www.mysql.com/doc/M/i/Missing_Sub-selects.html) Jeremy -- Jeremy D. Zawodny, [EMAIL PROTECTED] Technical Yahoo - Yahoo

Re: sub queries

2001-01-18 Thread Mark Marshall
, Is there any kind of schedule that says when the next MySQL version will be available? I'd like to utilize MySQL here, but I can't really start to seriously work on it until sub-queries are possible. Thanks! Mark - Before

Re: sub queries

2001-01-18 Thread Benjamin Pflugmann
working with. It'll take me a day or two to get it to that point again. If you're still willing to help, I'll be happy to do it and post it to the group. Thanks! Mark PS. Here's the Access SQL querie that I have to convert... Sorry, but the query you quoted doesn't use sub-queries, does

sub queries

2001-01-16 Thread Mark Marshall
Hi all, Is there any kind of schedule that says when the next MySQL version will be available? I'd like to utilize MySQL here, but I can't really start to seriously work on it until sub-queries are possible. Thanks! Mark

RE: sub queries

2001-01-16 Thread Oson, Chris M.
[mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 16, 2001 1:00 PM To: [EMAIL PROTECTED] Subject: sub queries Hi all, Is there any kind of schedule that says when the next MySQL version will be available? I'd like to utilize MySQL here, but I can't really start to seriously work on it until sub