Re: SQL query help. Retrieve all DVDs that have at least one scene of a certain encoding format

2012-05-19 Thread Mark Kelly
Hi. On Friday 18 May 2012 18:21:07 Daevid Vincent wrote: Actually, I may have figured it out. Is there a better way to do this? I don't see why you need the dvds table when the dvd_id is in the scene table: SELECT a.dvd_id FROM scenes_list a, moviefiles b WHERE a.scene_id = b.scene_id AND

RE: SQL query help. Retrieve all DVDs that have at least one scene of a certain encoding format

2012-05-19 Thread Daevid Vincent
...@wastedtimes.net] Sent: Saturday, May 19, 2012 3:34 PM To: mysql@lists.mysql.com Subject: Re: SQL query help. Retrieve all DVDs that have at least one scene of a certain encoding format Hi. On Friday 18 May 2012 18:21:07 Daevid Vincent wrote: Actually, I may have figured it out. Is there a better

Re: SQL query help. Retrieve all DVDs that have at least one scene of a certain encoding format

2012-05-19 Thread Baron Schwartz
I would work from the inside out. What you're doing is grouping scenes by DVD and throwing away the ones that have no scenes. If you start with DVDs and do a subquery for each row, you'll process DVDs without scenes and then filter them out. If you start with a subquery that's grouped by DVD ID,

RE: SQL query help. Retrieve all DVDs that have at least one scene of a certain encoding format

2012-05-18 Thread Daevid Vincent
-Original Message- Sent: Friday, May 18, 2012 5:34 PM I have a table of DVDs, another of scenes and a last one of encoding formats/files... I want to find in one query all the dvd_id that have 0 scene_id that's encoded in format_id = 13. In other words all DVDs that are

Re: sql query advise

2011-06-24 Thread Johan De Meersman
Have a look at GROUP BY and aggregate functions: http://dev.mysql.com/doc/refman/5.0/en/group-by-functions.html - Original Message - From: Norman Khine nor...@khine.net To: mysql@lists.mysql.com Sent: Thursday, 23 June, 2011 4:05:35 PM Subject: sql query advise hello, i have this

Re: sql query advise

2010-04-23 Thread Norman Khine
hi martin, On Fri, Apr 23, 2010 at 9:50 PM, Martin Gainty mgai...@hotmail.com wrote: Norm- I would strongly suggest locking the table before updating..a SELECT for UPDATE would accomplish that objective: thanks for the reply and the advise on locking the table SELECT oppc_id, limitedDate

Re: SQL query for unique values.

2010-02-15 Thread Manasi Save
Hi, A simple group by function should work for this: Select Fruit,GrownInStates From tbl1 Group By Fruit; and if you want grownstates in comma separated format then you can use Group_Concat function Select Fruit, Group_Concat(GrownInStates, SEPARATOR ',') From tbl1 Group By Fruit; Hope

Re: SQL query question for GROUP BY

2008-04-15 Thread Victor Danilchenko
I just thought of something else... could the same be accomplished using stored routines? I could find no way in MySQL to create stored routines which could be used with the 'group by' queries though. If this were possible, it should then be also possible to define a 'LAST' stored routine,

Re: SQL query question for GROUP BY

2008-04-15 Thread Perrin Harkins
On Fri, Apr 11, 2008 at 4:01 PM, Victor Danilchenko [EMAIL PROTECTED] wrote: Oooh, this looks evil. It seems like such a simple thing. I guess creating max(log_date) as a field, and then joining on it, is a solution -- but my actual query (not the abridged version) is already half a

Re: SQL query question for GROUP BY

2008-04-11 Thread Rob Wultsch
On Fri, Apr 11, 2008 at 11:46 AM, Victor Danilchenko [EMAIL PROTECTED] wrote: GROUP BY seems like an obvious choice; 'GROUP BY username', to be exact. However, this seems to produce not the last row's values, but ones from a random row in the group. Under most databases your query is

Re: SQL query question for GROUP BY

2008-04-11 Thread Victor Danilchenko
Oooh, this looks evil. It seems like such a simple thing. I guess creating max(log_date) as a field, and then joining on it, is a solution -- but my actual query (not the abridged version) is already half a page long. I think at this point, unless someone else suggests a better solution,

Re: SQL query question for GROUP BY

2008-04-11 Thread Rob Wultsch
On Fri, Apr 11, 2008 at 1:01 PM, Victor Danilchenko [EMAIL PROTECTED] wrote: Oooh, this looks evil. It seems like such a simple thing. I guess creating max(log_date) as a field, and then joining on it, is a solution -- but my actual query (not the abridged version) is already half a

Re: SQL query problem

2007-11-14 Thread Ravi Kumar.
Dear Mat, Your mail is not very clear. But I have a feeling that using '%' wildcard in the like operand should help you Regards, Ravi. On 11/14/07, Matthew Stuart [EMAIL PROTECTED] wrote: Hi, I have built a site with Dreamweaver and I have a problem with a query. I am trying to pass a

Re: SQL Query Question

2007-01-21 Thread Dan Nelson
In the last episode (Jan 22), Adam Bishop said: If I have a dataset as below: Name, Age, Word Bob, 13, bill Joe, 13, oxo Alex, 14, thing Jim, 14, blob Phil, 14, whatsit Ben, 15, doodah Rodney, 15, thingy I want to select the first block where the age is

RE: SQL Query Question

2007-01-21 Thread Adam Bishop
Ah, that would work. Looks like I was making the problem too complex in my mind, thanks for your help. Adam Bishop -Original Message- From: Dan Nelson [mailto:[EMAIL PROTECTED] Sent: 22 January 2007 07:07 To: Adam Bishop Cc: mysql@lists.mysql.com Subject: Re: SQL Query Question

Re: sql query

2006-10-17 Thread Dan Buettner
Hi Peter - Something like this ought to work: SELECT t1.id_2 FROM mytable t1, mytable t2 WHERE t1.id_1 = t2.id_1 AND t1.id != t2.id AND ABS( UNIX_TIMESTAMP(t1.date_time) - UNIX_TIMESTAMP(t2.date_time) ) = 300 Dan On 10/17/06, Peter [EMAIL PROTECTED] wrote: Hello, Lets suppose I have a table

Re: sql query

2006-10-17 Thread Peter Brawley
I want to find all id_2 that has same id_1 and time difference in records is no more than 5 minutes ... How about ... SELECT id_2 FROM tbl AS t1 JOIN tbl AS t2 ON t1.id_2 = t2.id_1 WHERE ABS(SEC_TO_TIME(t1.date_time)-SEC_TO_TIME(t2.date_time))=300; PB - Peter wrote: Hello, Lets

Re: sql query

2006-10-17 Thread Rolando Edwards
Sent: Tuesday, October 17, 2006 2:55:37 PM GMT-0500 US/Eastern Subject: Re: sql query Hi Peter - Something like this ought to work: SELECT t1.id_2 FROM mytable t1, mytable t2 WHERE t1.id_1 = t2.id_1 AND t1.id != t2.id AND ABS( UNIX_TIMESTAMP(t1.date_time) - UNIX_TIMESTAMP(t2.date_time) ) = 300 Dan

Re: sql query

2006-10-17 Thread Peter
Rolando Edwards wrote: Dan's is correct because Thank you ALL for your kind help !!! Send instant messages to your online friends http://uk.messenger.yahoo.com -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL

RE: SQL query taking a long time...please

2005-08-02 Thread Kapoor, Nishikant
Just wondering if someone would be kind enough to take a look at it - Nishi -Original Message- Following query is taking a long time (upto 10 secs) to return the resultset. Would greatly appreciate if someone could help me understand why. I have run 'analyze table tablename' on

RE: SQL query taking a long time...please

2005-08-02 Thread mos
At 01:58 PM 8/2/2005, you wrote: Just wondering if someone would be kind enough to take a look at it - Nishi Nishi, What did EXPLAIN show? Also what happens if you have just one Match? Is it faster? If so, why not run 2 queries and build a temporary table from the results. Using OR

RE: SQL query taking a long time...please

2005-08-02 Thread SGreen
Kapoor, Nishikant [EMAIL PROTECTED] wrote on 08/02/2005 02:58:08 PM: Just wondering if someone would be kind enough to take a look at it - Nishi -Original Message- Following query is taking a long time (upto 10 secs) to return the resultset. Would greatly appreciate if someone

RE: SQL query taking a long time...please

2005-08-02 Thread Kapoor, Nishikant
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 02, 2005 3:14 PM To: Kapoor, Nishikant Cc: mysql@lists.mysql.com Subject: RE: SQL query taking a long time...please Kapoor, Nishikant [EMAIL PROTECTED] wrote on 08/02/2005 02:58:08 PM: Just

Re: sql query to return unique ids from a table of date stamped results

2004-11-06 Thread Gleb Paharenko
Hi. May be it will be helpful: http://dev.mysql.com/doc/mysql/en/TIMESTAMP_4.1.html Rob Keeling [EMAIL PROTECTED] wrote: I am trying to find the sql statement needed to extract, from a table of data with multiple instances of a id no, a list of unique id nos, picking the latest (by

Re: sql query to return unique ids from a table of date stamped results

2004-11-06 Thread Michael Stassen
For each ADNO, you want the row with Lastupdatetime equal to that group's MAX(Lastupdatetime) . This is a little bit tricky and a frequently asked question. There are 3 ways to do it documented in the manual http://dev.mysql.com/doc/mysql/en/example-Maximum-column-group-row.html. Michael Rob

Re: sql query to return unique ids from a table of date stamped results

2004-11-06 Thread Michael Stassen
How will that help? He already has a timestamp column. He's asking how to get the rows conataining the groupwise maximum timestamps. Michael Gleb Paharenko wrote: Hi. May be it will be helpful: http://dev.mysql.com/doc/mysql/en/TIMESTAMP_4.1.html Rob Keeling [EMAIL PROTECTED] wrote: I am

Re: SQL Query Question

2004-08-14 Thread Michael Stassen
You need to join the employee table twice, once for each id lookup, like this: SELECT es.name AS sales_name, em.name AS marketing_name, leads.id FROM leads JOIN employee es ON leads.salesid = es.id JOIN employee em ON leads.marketingid = em.id; Michael Michael J. Pawlowsky wrote:

Re: SQL Query Question

2004-08-14 Thread Michael J. Pawlowsky
Thanks a lot Michael. A regular join did not seem to work. But when I tried a LEFT JOIN it worked. A cut down example of it is the following. SELECT global_lead.id, rep_no, es.fname as sales_name, em.fname as marketing_name FROM global_lead LEFT JOIN global_employee es ON global_lead.rep_no =

Re: SQL Query Question

2004-08-14 Thread Michael Stassen
Right. If the employee ID in either the rep_no or entered_by columns does not have a corresponding row in the global_employee table, then the regular join won't match that row. In that case, as you found, you need a LEFT JOIN, which guarantees you get the rows from the table on the left, and

Re: Sql Query Issue

2004-07-13 Thread SGreen
I suggest that you add more indexes to your tables. If you run an EXPLAIN on your query, you will see that you are doing WAY too many table scans and that is what is slowing you down. Index the columns in each table that reference the ID values of another table. Then run your EXPLAIN again and

Re: Sql Query Issue

2004-07-12 Thread Stefan Kuhn
This is an index problem. Your tables don't contain any indices except on PKs. This can't work, given the number of joins and table sizes. Read the doc about indices. Stefan Am Monday 12 July 2004 09:55 schrieb Jeyabalan Murugesan Sankarasubramanian: Hi All, I migrated the data from Oracle to

RE: SQL Query Question

2004-04-17 Thread Victor Pendleton
The you will need to use the second format. DATE_FORMAT(queue_time, '%Y%m%d') = CURRENT_DATE() -Original Message- From: Dirk Bremer (NISC) To: [EMAIL PROTECTED] Sent: 4/16/04 4:09 PM Subject: Re: SQL Query Question - Original Message - From: Victor Pendleton [EMAIL PROTECTED

Re: SQL Query Question

2004-04-17 Thread Michael Stassen
If you do any math on your column, no index on the column can be used. If possible, you should always try to write your condition so that the calculations are done on the value(s) to compare to, not on the column. So, assuming you have no rows with future timestamps, something like this

RE: SQL Query Question

2004-04-16 Thread Scott Purcell
This works for Oracle, give it a try, use any format you want for the MM/DD/YY area. select to_char(queue_time, 'MM/DD/YY'); Scott Purcell -Original Message- From: Dirk Bremer (NISC) [mailto:[EMAIL PROTECTED] Sent: Friday, April 16, 2004 2:55 PM To: [EMAIL PROTECTED] Subject: SQL

RE: SQL Query Question

2004-04-16 Thread Victor Pendleton
WHERE queue_time = Now() + 0 Are you wanting just the date or the datetime? -Original Message- From: Dirk Bremer (NISC) To: [EMAIL PROTECTED] Sent: 4/16/04 2:54 PM Subject: SQL Query Question I have a simple table where one of the columns is named queue_time and is defined as a

Re: SQL Query Question

2004-04-16 Thread Dirk Bremer \(NISC\)
- Original Message - From: Victor Pendleton [EMAIL PROTECTED] To: 'Dirk Bremer (NISC) ' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, April 16, 2004 15:06 Subject: RE: SQL Query Question WHERE queue_time = Now() + 0 Are you wanting just the date or the datetime? -Original

RE: SQL Query Question

2004-04-16 Thread Victor Pendleton
%m%d') = CURRENT_DATE() + 0 ...no index usage though -Original Message- From: Dirk Bremer (NISC) To: [EMAIL PROTECTED] Sent: 4/16/04 3:25 PM Subject: Re: SQL Query Question - Original Message - From: Victor Pendleton [EMAIL PROTECTED] To: 'Dirk Bremer (NISC) ' [EMAIL PROTECTED

Re: SQL Query Question

2004-04-16 Thread Dirk Bremer \(NISC\)
- Original Message - From: Victor Pendleton [EMAIL PROTECTED] To: 'Dirk Bremer (NISC) ' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, April 16, 2004 15:57 Subject: RE: SQL Query Question If your data is stored in the following format 2004-04-16 00:00:00 you can do WHERE

Re: SQL Query Question

2004-04-16 Thread Garth Webb
On Fri, 2004-04-16 at 14:09, Dirk Bremer (NISC) wrote: - Original Message - From: Victor Pendleton [EMAIL PROTECTED] To: 'Dirk Bremer (NISC) ' [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Friday, April 16, 2004 15:57 Subject: RE: SQL Query Question If your data is stored

Re: SQL Query problem

2004-02-20 Thread Duncan Hill
On Friday 20 February 2004 15:19, Claire Lee wrote: Hi All, I have a query problem here. Say I have a table with employee records of three different departments. If each department manager wants to see employee info of their own department. Three different queries will be needed. Is there a

Re: SQL Query help

2004-02-19 Thread unix
This is probably tediously basic for all you super whiz MySQL people but help me out if you can. I have 2 tables in my database (there will be more) table_Applics table_keywords I want to select columns of information from table_applics based on the ID results from table_keywords.

Re: SQL query help required

2004-02-03 Thread Jigal van Hemert
- Original Message - From: Riaan Oberholzer [EMAIL PROTECTED] 2-0, 2-1, 2-2, 2-3 1-0, 1-1, 1-2, 1-3 0-0, 0-1, 0-2, 0-3 SELECT CONCAT(predictionA, '-', predictionB) AS score, COUNT(CONCAT(predictionA, '-', predictionB)) AS count FROM table WHERE CONCAT(predictionA, '-', predictionB)

Re: SQL Query Question

2004-01-20 Thread sulewski
Hello, For my final solution I decided to use the inner join method. The query is created dynamically based upon a user interface component that allows people to build queries using parenthesis, ands and or's. Plus there is another field that I didn't include in the original question so as

Re: SQL Query Question

2004-01-20 Thread sulewski
I think I figured out the time problem. If I make s2 in the or s1 and remove any instances of s2 it works very fast with the 'or'. Joe On Tuesday, January 20, 2004, at 09:50 AM, sulewski wrote: Hello, For my final solution I decided to use the inner join method. The query is created

Re: SQL Query Question

2004-01-19 Thread sulewski
Let me post the question this way, MyTable --- pointerid valueid 811 54 811 63 812 100 813 200 814 300 815 400 I want all the records in MyTable

Re: SQL Query Question

2004-01-19 Thread Michael Satterwhite
On Monday 19 January 2004 13:17, sulewski wrote: Okay, I think I'm missing something obvious. I have two tables Table 1 Table 2 ___ _ ID rdid vid ___

Re: SQL Query Question

2004-01-19 Thread Jochem van Dieten
Michael Satterwhite said: On Monday 19 January 2004 13:17, sulewski wrote: Okay, I think I'm missing something obvious. I have two tables Table 1 Table 2 ___ _ ID rdid vid

RE: SQL Query Question

2004-01-19 Thread Lincoln Milner
- From: Jochem van Dieten [mailto:[EMAIL PROTECTED] Sent: Monday, January 19, 2004 4:39 PM To: [EMAIL PROTECTED] Subject: Re: SQL Query Question Michael Satterwhite said: On Monday 19 January 2004 13:17, sulewski wrote: Okay, I think I'm missing something obvious. I have two tables Table 1

Re: SQL Query Question

2004-01-19 Thread sulewski
Jochem, I believe this works. This is also easy to build dynamically. The query is going to be generated based upon some user input. Thank you very much, Joe On Monday, January 19, 2004, at 04:38 PM, Jochem van Dieten wrote: Michael Satterwhite said: On Monday 19 January 2004 13:17,

RE: SQL Query Question

2004-01-19 Thread Jochem van Dieten
Lincoln Milner said: Or, if I'm not mistaken, you could do something like: SELECT t1.* FROM table1 t1, table2 t2 WHERE t1.id = t2.rdid AND t2.vid IN (46, 554) ; That should work No. You are back to square one where there should only be one record in t2 with a vid of either 46 or

Re: SQL Query Question

2004-01-19 Thread Michael Satterwhite
On Monday 19 January 2004 15:38, Jochem van Dieten wrote: So let's make it 2 fields: SELECT t1.* FROM table1 t1, table2 t2 INNER JOIN table2 t3 ON (t2.rdid = t3.rdid AND t2.vid = 46 AND t3.vid = 554) WHERE t1.rdid = t2.rdid Add GROUP BY/DISTINCT per your requirements.

Re: SQL Query Question

2004-01-19 Thread Jochem van Dieten
Michael Satterwhite said: On Monday 19 January 2004 15:38, Jochem van Dieten wrote: So let's make it 2 fields: SELECT t1.* FROM table1 t1, table2 t2 INNER JOIN table2 t3 ON (t2.rdid = t3.rdid AND t2.vid = 46 AND t3.vid = 554) WHERE t1.rdid = t2.rdid Add GROUP BY/DISTINCT

Re: SQL Query Question

2004-01-19 Thread Michael Satterwhite
On Monday 19 January 2004 16:30, Jochem van Dieten wrote: Michael Satterwhite said: On Monday 19 January 2004 15:38, Jochem van Dieten wrote: So let's make it 2 fields: SELECT t1.* FROM table1 t1, table2 t2 INNER JOIN table2 t3 ON (t2.rdid = t3.rdid AND t2.vid = 46 AND

Re: SQL Query Question

2004-01-19 Thread Jochem van Dieten
Michael Satterwhite wrote: On Monday 19 January 2004 16:30, Jochem van Dieten wrote: Michael Satterwhite said: On Monday 19 January 2004 15:38, Jochem van Dieten wrote: So let's make it 2 fields: SELECT t1.* FROM table1 t1, table2 t2 INNER JOIN table2 t3 ON (t2.rdid = t3.rdid AND t2.vid

Re: SQL Query

2004-01-18 Thread Terry Riley
I think it should be: SELECT * FROM articles WHERE sectionID=1 ORDER BY Entrydate Desc LIMIT 1,10 Terry --Original Message- Any idea what is wrong with the following: SELECT * From articles ORDER BY EntryDate DESC LIMIT 1,10 WHERE SectionID=1 I want to return all

Re: SQL Query

2004-01-18 Thread Ian O'Rourke
From: Terry Riley [EMAIL PROTECTED] I think it should be: SELECT * FROM articles WHERE sectionID=1 ORDER BY Entrydate Desc LIMIT 1,10 Terry That would be correct. I'll have to watch out for that ordering in the future. What confused me is if you just have the Select, Order By and Where

RE: SQL Query

2004-01-18 Thread Peter Lovatt
SELECT * From articles WHERE SectionID=1 ORDER BY EntryDate DESC LIMIT 1,10 the where clause should be after the table name HTH Peter -Original Message- From: Ian O'Rourke [mailto:[EMAIL PROTECTED] Sent: 18 January 2004 11:22 To: [EMAIL PROTECTED] Subject: SQL Query Any idea what

Re: SQL Query

2004-01-18 Thread Bernard Clement
My guess will be that the where clause is misplaced. Try SELECT * From articles WHERE SectionID=1 ORDER BY EntryDate DESC LIMIT 1,10 PLS read URL: http://www.mysql.com/doc/en/SELECT.html On that page it is stated that: All clauses used must be given in exactly the order shown in the syntax

Re: sql query for faceted classification system

2004-01-02 Thread Roger Baklund
* Seamus R Abshere i am developing a photo gallery with php4/mysql4.0 that uses faceted classification. -my tables: photos(photoid) metadata(photoid,facetid) -to select all of the photoid's that are associated with either facetid 1 or 2: SELECT DISTINCT photos.* FROM

RE: SQL query question

2003-11-11 Thread Andy Eastham
Pael, Try this: SELECT firmal.beskrivelse as Businessline, lokasjon.navn as Location, count(person.[uniqueid]) FROM firmal INNER JOIN ( person INNER JOIN lokasjon ON person.lokid = lokasjon.lokid) ON firmal.firmalid = person.firmalid GROUP BY firmal.beskrivelse, lokasjon.navn Replace [uniqueid]

RE: SQL query question

2003-11-11 Thread Paal Eriksen
So close, Thanks you very much Andy. I tried one similar to your suggestion, but didn't get quite the result i expected. Cheers Paal Ny versjon av Yahoo! Messenger Nye ikoner og bakgrunner, webkamera med superkvalitet og dobbelt så morsom

Re: SQL query question

2003-11-11 Thread Leo
try group by SELECT firmal.beskrivelse as Businessline, lokasjon.navn as Location, count(person.name) as Sum People FROM firmal INNER JOIN ( person INNER JOIN lokasjon ON person.lokid = lokasjon.lokid) ON firmal.firmalid = person.firmalid group by firmal.beskrivelse, lokasjon.navn -leo- From:

Re: SQL query needed

2003-10-20 Thread Roger Baklund
* Reto Baumann I'm working on a book database with some special requirements. Each book is associated with some keywords and put into a category. Category 0 is special, as this is Unsorted, i.e. not associated with a category (which most books are at the moment). For thei query, let's

Re: SQL query help

2003-10-02 Thread Svein E. Seldal
Hi, I forgot to mention that the table contains more information, it has more columns than just a and b. These extra columns contains the actual information that I'm looking for. I.e. the mentioned table could be looking like this: +--+--+--+--+-+--- | a| b|

Re: SQL query crashes MySQL

2003-09-12 Thread Sergei Golubchik
Hi! On Sep 12, Irwin Boutboul wrote: Here it is: select floor(avg(selection.bandwidth))*8000 as avgbandwidth from (select avg(bandwidth) as bandwidth from FEEDBACK_DOWNLOADS where servername= ? and ( bytesdownloaded 50 or timeduration 3000 ) group by id order by starttime desc

RE: SQL query crashes MySQL

2003-09-12 Thread Irwin Boutboul
RE: SQL query crashes MySQL Does that crash the server in command-line mode (via mysql) or just in MySQLcc? I've seen similar crashes (actual full server crashes) in similar queries but only under mysqlcc. It seems that the results come back but the server dies just after that point

RE: SQL Query Syntax Error

2003-07-08 Thread Tab Alleman
Trevor Sather wrote: Hello The following query used to work when I was using an Access database, but now that I've moved to MySQL I get a syntax error when I try and run it: SELECT *, (SELECT COUNT (*) FROM Links WHERE Links.CAT_ID = Categories.CAT_ID AND LINK_APPROVED = 'Yes') AS

Re: SQL Query

2003-06-24 Thread Becoming Digital
SELECT Place.id, Place.name FROM Place LEFT JOIN Place_link ON Place.id=Place_link.Place WHERE Place.id!=1 AND Place_link.LinkTo!=1; This section of the manual will probably help you further. http://www.mysql.com/doc/en/ANSI_diff_Sub-selects.html Edward Dudlik Becoming Digital

RE: SQL query - 3 tables - 3rd one conatins records to not display

2003-06-23 Thread Mike Hillyer
What you need is a LEFT JOIN. When you use a LEFT JOIN, you get all rows from your main table, with either the data from the penpals_privmsgs_block table if there is corresponding data, or NULL if there is no related row. Take a look here: http://www.mysql.com/doc/en/JOIN.html for more

RE: SQL query - 3 tables - 3rd one conatins records to not display

2003-06-23 Thread vernon
OK so now I have something like this: SELECT distinct useronline.uname, penpals_fav.fav_user_id, penpals_fav.ID, penpals_privmsgs_block.user_id, penpals_privmsgs_block.blocked_id FROM useronline, penpals_privmsgs_block left join penpals_fav on penpals_privmsgs_block.user_id WHERE

RE: SQL query - 3 tables - 3rd one conatins records to not display

2003-06-23 Thread Mike Hillyer
PROTECTED] Subject: RE: SQL query - 3 tables - 3rd one conatins records to not display OK so now I have something like this: SELECT distinct useronline.uname, penpals_fav.fav_user_id, penpals_fav.ID, penpals_privmsgs_block.user_id, penpals_privmsgs_block.blocked_id FROM useronline

RE: SQL query - 3 tables - 3rd one conatins records to not display

2003-06-23 Thread vernon
OK so now I have: SELECT distinct useronline.uname, penpals_fav.fav_user_id, penpals_fav.ID, penpals_privmsgs_block.user_id, penpals_privmsgs_block.blocked_id FROM useronline, penpals_fav LEFT JOIN penpals_privmsgs_block ON penpals_fav.user_id = penpals_privmsgs_block.user_id WHERE

Re: SQL query - 3 tables - 3rd one conatins records to not display

2003-06-23 Thread gerald_clark
And what happens if you leave off the 'distinct' ? vernon wrote: OK so now I have: SELECT distinct useronline.uname, penpals_fav.fav_user_id, penpals_fav.ID, penpals_privmsgs_block.user_id, penpals_privmsgs_block.blocked_id FROM useronline, penpals_fav LEFT JOIN penpals_privmsgs_block ON

Re: SQL query - 3 tables - 3rd one conatins records to not display

2003-06-23 Thread vernon
--- From: gerald_clark [EMAIL PROTECTED] To: vernon [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Mon, 23 Jun 2003 11:13:53 -0500 Subject: Re: SQL query - 3 tables - 3rd one conatins records to not display And what happens if you leave off the 'distinct' ? -- MySQL General Mailing List

RE: SQL query question

2003-06-20 Thread TheMechE
Rolf, You need to separate your functions. You are adding complexity to your world by storing irrelvant infromation in your database. Critical Data Handling (in a proper world) is ALWAYS handled separately from display. So in your example, You are storing all the html display formatting in

RE: SQL query question

2003-06-19 Thread Mike Hillyer
Well, from what limited info I have, it looks like your image tag is not closed properly. Regards, Mike Hillyer www.vbmysql.com -Original Message- From: Rolf C [mailto:[EMAIL PROTECTED] Sent: Thursday, June 19, 2003 2:57 PM To: [EMAIL PROTECTED] Subject: SQL query question

RE: sql,query

2003-03-21 Thread Roger Davis
not really for mhsql list, more for php list but,,, select your database after connection. use echo statement to look at you queries. check your punctuation Roger -Original Message- From: Karl James [mailto:[EMAIL PROTECTED] Sent: Friday, March 21, 2003 6:51 PM To: [EMAIL PROTECTED]

Re: SQL QUERY

2003-03-17 Thread Paul DuBois
At 14:40 +0100 3/17/03, [EMAIL PROTECTED] wrote: Problem with the following SQL Query: How do I combine DISTINCT with the SELECT * ? Is it SELECT DISTINCT * FROM...? This doesn´t work in my project. SELECT DISTINCT * FROM ... should work. What is your exact query, and what error message do you

RE: sql query using select and row functions

2003-01-29 Thread Christopher Lyon
Thank you all for your help. I think that is all I need to do is select it by row. -Original Message- From: R. Hannes Niedner [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 28, 2003 2:02 PM To: Christopher Lyon; MySQL Mailinglist Subject: Re: sql query using select and row

RE: sql query using select and row functions

2003-01-28 Thread Mike Hillyer
Why not just reverse your order by clause and use Limit 5? Mike Hillyer -Original Message- From: Christopher Lyon [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 28, 2003 9:26 AM To: [EMAIL PROTECTED] Subject: sql query using select and row functions I am trying to do an sql query

Re: sql query using select and row functions

2003-01-28 Thread R. Hannes Niedner
On 1/28/03 8:26 AM, Christopher Lyon [EMAIL PROTECTED] wrote: I am trying to do an sql query and am trying to select the last x rows from the database. I see the limit function but that seems like that is from the first row down. I want to start from the last row to the first row. So,

RE: sql query using select and row functions

2003-01-28 Thread Fernando Grijalba
Try ordering the records backwards, e.g ORDER BY id DESC and then limit 0, 5 HTH JFernando * sql * -Original Message- From: Christopher Lyon [mailto:[EMAIL PROTECTED]] Sent: January 28, 2003 11:26 To: [EMAIL PROTECTED] Subject: sql query using select and row functions I am trying to

RE: sql query using select and row functions

2003-01-28 Thread Victor Pendleton
Do you mean the last five rows in the database or the last five rows entered into the database? Either way, Last five rows select [someColumn] from [someTable] ORDER BY [someColumn] DESC LIMIT 0, 5 If the total number of rows is known select [someColumn] from [someTable] ORDER BY

RE: sql query using select and row functions

2003-01-28 Thread Christopher Lyon
I would think they would be the same no? It turns out in the database that they are the same. -Original Message- From: Victor Pendleton [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 28, 2003 12:23 PM To: Christopher Lyon; [EMAIL PROTECTED] Subject: RE: sql query using select

RE: sql query using select and row functions

2003-01-28 Thread Victor Pendleton
Pendleton; [EMAIL PROTECTED] Subject: RE: sql query using select and row functions I would think they would be the same no? It turns out in the database that they are the same. -Original Message- From: Victor Pendleton [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 28, 2003 12:23

Re: sql query using select and row functions

2003-01-28 Thread R. Hannes Niedner
. Hannes Niedner [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 28, 2003 11:50 AM To: Christopher Lyon; MySQL Mailinglist Subject: Re: sql query using select and row functions On 1/28/03 8:26 AM, Christopher Lyon [EMAIL PROTECTED] wrote: I am trying to do an sql query and am trying

Re: sql query using select and row functions

2003-01-28 Thread Adolfo Bello
On Tue, 2003-01-28 at 12:26, Christopher Lyon wrote: I am trying to do an sql query and am trying to select the last x rows from the database. I see the limit function but that seems like that is from the first row down. I want to start from the last row to the first row. So, selecting the

re: sql query LOAD DATA INFILE question

2002-12-17 Thread Victoria Reznichenko
On Tuesday 17 December 2002 11:08, moka at hol dot gr wrote: I am looking at the following situation: I am reading some files arriving every minute and parsing them and creating a set of files ready to be inserted into tables. on the fly. While I am waiting for the next

RE: SQL Query

2002-11-18 Thread John W Higgins
While not pretty the following would do it SUBSTRING_INDEX(SUBSTRING_INDEX(value, ',', 3), ',', -1) John W Higgins [EMAIL PROTECTED] -Original Message- From: Paul van Brouwershaven [mailto:[EMAIL PROTECTED]] Sent: Saturday, November 16, 2002 5:46 AM To: [EMAIL PROTECTED] Subject: SQL

Re: SQL Query

2002-11-18 Thread Richard Clarke
van Brouwershaven [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Saturday, November 16, 2002 4:50 PM Subject: Re: SQL Query First of all, don't do this in mysql . If you got a dump of the database, using cut utility u can easily extract the second field in the delimited by the comma

RE: SQL Query

2002-11-16 Thread Thoenen, Peter Mr. EPS
Why not just split that field up into multiple fields. Seems ridiculous to have multiple values in a single field in a RDMS -Peter -Original Message- From: Paul van Brouwershaven [mailto:[EMAIL PROTECTED]] Sent: Saturday, November 16, 2002 14:46 To: [EMAIL PROTECTED] Subject: SQL

RE: SQL Query

2002-11-16 Thread Paul van Brouwershaven
I'ts a dump of an other database with more than 4 million records -Original Message- From: Thoenen, Peter Mr. EPS [mailto:[EMAIL PROTECTED]] Sent: Saturday, November 16, 2002 2:54 PM To: 'Paul van Brouwershaven'; [EMAIL PROTECTED] Subject: RE: SQL Query Why not just split

Re: SQL Query

2002-11-16 Thread Dennis Salguero
- Original Message - From: Paul van Brouwershaven [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Saturday, November 16, 2002 8:58 AM Subject: RE: SQL Query I'ts a dump of an other database with more than 4 million records Yeah, but that still doesn't mean that you can't use the earlier

RE: SQL Query

2002-11-16 Thread Paul van Brouwershaven
The number of values is also not the same, this can be 1 till +/-30 values -Original Message- From: Dennis Salguero [mailto:[EMAIL PROTECTED]] Sent: Saturday, November 16, 2002 1:46 PM To: Paul van Brouwershaven; [EMAIL PROTECTED] Subject: Re: SQL Query - Original Message

RE: SQL Query

2002-11-16 Thread Paul van Brouwershaven - Networking4all
Sorry it's default -Original Message- From: Peter Brawley [mailto:[EMAIL PROTECTED]] Sent: Saturday, November 16, 2002 5:23 PM To: Paul van Brouwershaven Subject: Re: SQL Query Please do NOT mark posted messages 'request reply'. - - Original Message - From

Re: SQL Query

2002-11-16 Thread Gurhan Ozen
First of all, don't do this in mysql . If you got a dump of the database, using cut utility u can easily extract the second field in the delimited by the comma.. and then split them into different columns in the table when you want to insert them into the mysql database. If you are still

Re: SQL Query

2002-11-16 Thread Gelu Gogancea
Hi, If the lenght of what wish to retrieve is fixed to 2 length,you can try something like this: select MID(YOUR_FIELD,3,IF(RIGHT(LPAD(YOUR_FIELD,4,','),1)=',',1,2)) from YOUR_TABLE; Regards, Gelu _ G.NET SOFTWARE COMPANY Permanent e-mail

RE: SQL Query

2002-11-07 Thread Fernando Grijalba
Is this line correct? MarketData INNER JOIN Contacts on MarketData.CustID=Contacts.ContactID WHERE Or should it be: MarketData INNER JOIN Contacts on MarketData.CustID=Contacts.CustID WHERE JFernando ** sql ** -Original Message- From: [EMAIL PROTECTED] [mailto:Sam4Software;aol.com]

Re: SQL Query

2002-11-07 Thread John Coder
On Thu, 2002-11-07 at 16:17, [EMAIL PROTECTED] wrote: Hi, I have the following SQL query, that returns the correct records on Access, but when I use it with MySQL, it returns duplicate records, and it skips the required records. SearchSQL=select

Re: SQL Query Help

2002-10-04 Thread Shane Allen
On Fri, Oct 04, 2002 at 12:36:30PM -0700, David McInnis wrote: Can someone please help me with the following? Normally I would do this with a nested select, but since this is not available in MySQL I think I need help. Here is what I have: An order table with sales tax total and an

  1   2   >