Re: Basic SELECT help

2012-12-18 Thread Shawn Green
Hi Neil, On 11/22/2012 7:14 PM, h...@tbbs.net wrote: 2012/11/22 14:30 +, Neil Tompkins I'm struggling with what I think is a basic select but can't think how to do it : My data is id,type 1000,5 1001,5 1002,2 1001,2 1003,2 1005,2 1006,1 From this I what to get a distinct list of id

Re: Basic SELECT help

2012-11-23 Thread divesh kamra
Hi Is there is performance issue from this query on more then 5-10 million data On Fri, Nov 23, 2012 at 11:17 AM, Mogens Melander mog...@fumlersoft.dkwrote: Ok, to make up for my bad joke, here's the answer to the original question. DROP TABLE IF EXISTS `test`.`atest`; CREATE TABLE

Basic SELECT help

2012-11-22 Thread Neil Tompkins
Hi, I'm struggling with what I think is a basic select but can't think how to do it : My data is id,type 1000,5 1001,5 1002,2 1001,2 1003,2 1005,2 1006,1 From this I what to get a distinct list of id where the type equals 2 and 5 Any ideas ? Neil

Re: Basic SELECT help

2012-11-22 Thread marek gutowski
SELECT DISTINCT id FROM table WHERE type IN ('2','5') should work On 22 November 2012 14:30, Neil Tompkins neil.tompk...@googlemail.comwrote: Hi, I'm struggling with what I think is a basic select but can't think how to do it : My data is id,type 1000,5 1001,5 1002,2 1001,2 1003,2

Re: Basic SELECT help

2012-11-22 Thread Mike OK
Hi Neil Would something like this work. SELECT DISTINCT id,type from your_table WHERE type=2 OR type=5; Mike - Original Message - From: Neil Tompkins neil.tompk...@googlemail.com To: [MySQL] mysql@lists.mysql.com Sent: Thursday, November 22, 2012 9:30 AM Subject: Basic SELECT help

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
Basically I only what to return the IDs that have both types. On Thu, Nov 22, 2012 at 2:39 PM, marek gutowski marek.gutow...@gmail.comwrote: SELECT DISTINCT id FROM table WHERE type IN ('2','5') should work On 22 November 2012 14:30, Neil Tompkins neil.tompk...@googlemail.comwrote: Hi,

Fwd: Basic SELECT help

2012-11-22 Thread Michael Dykman
response did not go to the list.. I assume that you mean the id must be associated with both type=5 AND type=2 as opposed to type=5 OR type=2; in some dialect of SQL (not mysql) you can do this: select distinct id from 'table' where type=5 intersect select distinct id from 'table' where type=2

Re: Basic SELECT help

2012-11-22 Thread Benaya Paul
U can remove the type field it will work On Nov 22, 2012 8:21 PM, Neil Tompkins neil.tompk...@googlemail.com wrote: Basically I only what to return the IDs that have both types. On Thu, Nov 22, 2012 at 2:39 PM, marek gutowski marek.gutow...@gmail.com wrote: SELECT DISTINCT id FROM table

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
How about if I have the following SELECT DISTINCT id FROM my_table WHERE (type = 3 OR type = 28 OR type = 1) In this instance, for the id 280149 it only has types 3 and 28 but *not *1. But using the OR statement returns id 280149 On Thu, Nov 22, 2012 at 2:53 PM, Benaya Paul

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
Michael, Thanks this kind of works if I'm checking two types. But what about if I have 5 types ? On Thu, Nov 22, 2012 at 2:53 PM, Michael Dykman mdyk...@gmail.com wrote: response did not go to the list.. I assume that you mean the id must be associated with both type=5 AND type=2 as

Re: Basic SELECT help

2012-11-22 Thread Michael Dykman
Keep joining I think. In the absence of intersect (which incurs the cost of a query per type anyhow ), this join pattern is the only option I can think of. On 2012-11-22 10:01 AM, Neil Tompkins neil.tompk...@googlemail.com wrote: Michael, Thanks this kind of works if I'm checking two types.

Re: Basic SELECT help

2012-11-22 Thread Ben Mildren
SELECT id FROM mytable WHERE type IN(x,y,z) GROUP BY id; On 22 November 2012 15:01, Neil Tompkins neil.tompk...@googlemail.com wrote: Michael, Thanks this kind of works if I'm checking two types. But what about if I have 5 types ? On Thu, Nov 22, 2012 at 2:53 PM, Michael Dykman

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
Do you know if I had multiple joins there would be a performance issue ? On Thu, Nov 22, 2012 at 3:06 PM, Michael Dykman mdyk...@gmail.com wrote: Keep joining I think. In the absence of intersect (which incurs the cost of a query per type anyhow ), this join pattern is the only option I can

Re: Basic SELECT help

2012-11-22 Thread Ben Mildren
Ah read it quickly and misread your requirement. Joins are likely FTW here. The alternative would be to do something like this, but I'd opt for the joins if you have a reasonably sized data set: SELECT id, GROUP_CONCAT(type ORDER BY type) AS typelist FROM mytable WHERE id IN(x,y,z) GROUP BY id

Re: Basic SELECT help

2012-11-22 Thread Michael Dykman
Of course there is a cost for the join, each link being a distinct lookup query but that is the same cost the INTERSECT would impose. It is not a bad as multiple joins generally might be as all the lookups are against the same key in the same table which should keep that index in ram. (type is

Re: Basic SELECT help

2012-11-22 Thread Ben Mildren
*HAVING typelist = 'x,y,z'; On 22 November 2012 15:25, Ben Mildren ben.mild...@gmail.com wrote: Ah read it quickly and misread your requirement. Joins are likely FTW here. The alternative would be to do something like this, but I'd opt for the joins if you have a reasonably sized data set:

RE: Basic SELECT help

2012-11-22 Thread Jason Trebilcock
[mailto:neil.tompk...@googlemail.com] Sent: Thursday, November 22, 2012 8:30 AM To: [MySQL] Subject: Basic SELECT help Hi, I'm struggling with what I think is a basic select but can't think how to do it : My data is id,type 1000,5 1001,5 1002,2 1001,2 1003,2 1005,2 1006,1 From

Re: Basic SELECT help

2012-11-22 Thread Michael Dykman
Assuming that (id,type) is unique in the source data, that is a pretty elegant method: select id from (select distinct id, count(*) from my_table where type in (2,5) group by id having count(*) = 2)a; -- - michael dykman - mdyk...@gmail.com May the Source be with you. -- MySQL

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
By unique you mean that no id and type would be duplicated like 1,1 1,1 Yes it isn't possible for duplicate id and type in more than 1 row On Thu, Nov 22, 2012 at 4:46 PM, Michael Dykman mdyk...@gmail.com wrote: Assuming that (id,type) is unique in the source data, that is a pretty elegant

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
When trying this query I get FUNCTION id does not exist On Thu, Nov 22, 2012 at 4:46 PM, Michael Dykman mdyk...@gmail.com wrote: select id from (select distinct id, count(*) from my_table where type in (2,5) group by id having count(*) = 2)a;

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
Ignore that it does work fine. Sorry On Thu, Nov 22, 2012 at 4:46 PM, Michael Dykman mdyk...@gmail.com wrote: Assuming that (id,type) is unique in the source data, that is a pretty elegant method: select id from (select distinct id, count(*) from my_table where type in (2,5) group

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
Doing a EXPLAIN on the SELECT statement it is using Using where; Using temporary; Using filesort with 14000 rows of data. How best to improve this; when I already have indexed on id and type On Thu, Nov 22, 2012 at 4:46 PM, Michael Dykman mdyk...@gmail.com wrote: Assuming that (id,type) is

Re: Basic SELECT help

2012-11-22 Thread Michael Dykman
On Thu, Nov 22, 2012 at 11:58 AM, Neil Tompkins neil.tompk...@googlemail.com wrote: By unique you mean that no id and type would be duplicated like 1,1 1,1 Yes it isn't possible for duplicate id and type in more than 1 row Yes, that's exactly what I meant. - mdyk...@gmail.com May the

Re: Basic SELECT help

2012-11-22 Thread Mogens Melander
Hmmm. OR, IN and HAVING pops up. On Thu, November 22, 2012 15:30, Neil Tompkins wrote: Hi, I'm struggling with what I think is a basic select but can't think how to do it : My data is id,type 1000,5 1001,5 1002,2 1001,2 1003,2 1005,2 1006,1 From this I what to get a distinct

Re: Basic SELECT help

2012-11-22 Thread Mogens Melander
On Thu, November 22, 2012 15:45, Neil Tompkins wrote: Basically I only what to return the IDs that have both types. And that's exactly what below statement will return. You forgot to include what platform you are on, which version of MySQL you are running and what class you are attending.

Re: Basic SELECT help

2012-11-22 Thread Michael Dykman
Mogens, Platform could not be less relevant to a question of MySql syntax. The techniques we have been discussing have been available to every version of MySql post v3.23 and the class/job function he is applying it to is neither relevant to the problem nor any of our business, unless he

Re: Basic SELECT help

2012-11-22 Thread hsv
2012/11/22 14:30 +, Neil Tompkins I'm struggling with what I think is a basic select but can't think how to do it : My data is id,type 1000,5 1001,5 1002,2 1001,2 1003,2 1005,2 1006,1 From this I what to get a distinct list of id where the type equals 2 and 5 Any ideas ? This ugly one,

Re: Basic SELECT help

2012-11-22 Thread hsv
2012/11/22 14:30 +, Neil Tompkins I'm struggling with what I think is a basic select but can't think how to do it : My data is id,type 1000,5 1001,5 1002,2 1001,2 1003,2 1005,2 1006,1 From this I what to get a distinct list of id where the type equals 2 and 5 Any ideas ? This ugly one,

Re: Basic SELECT help

2012-11-22 Thread Claudio Nanni
On 11/22/2012 04:10 PM, Ben Mildren wrote: SELECT id FROM mytable WHERE type IN(x,y,z) GROUP BY id; Ben you were almost there ;) SELECT id FROM mytable WHERE type IN(x,y,z) GROUP BY id HAVING COUNT(id)=num of params The only bad is the hardcoded parameter in the HAVING, may be it might be

Re: Basic SELECT help

2012-11-22 Thread Mogens Melander
Ok, to make up for my bad joke, here's the answer to the original question. DROP TABLE IF EXISTS `test`.`atest`; CREATE TABLE `test`.`atest` ( `id` int(10) unsigned NOT NULL, `type` int(10) unsigned NOT NULL, PRIMARY KEY (`id`) USING BTREE ) ENGINE=MyISAM DEFAULT CHARSET=utf8; insert into

Re: Basic SELECT help

2012-11-22 Thread Neil Tompkins
Claudio This is the solution i decided to go for as provided in a previous response. Thanks Neil On 23 Nov 2012, at 00:41, Claudio Nanni claudio.na...@gmail.com wrote: On 11/22/2012 04:10 PM, Ben Mildren wrote: SELECT id FROM mytable WHERE type IN(x,y,z) GROUP BY id; Ben you were almost

Re: SELECT Help

2011-02-04 Thread Tompkins Neil
as team_id, away_user_id as user_id, last_changed from data) s1 where s1.user_id = 3 group by team_id, user_id; -Travis -Original Message- From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] Sent: Thursday, February 03, 2011 6:34 AM To: [MySQL] Subject: SELECT Help Hi, I've

SELECT Help

2011-02-03 Thread Tompkins Neil
Hi, I've the following list of sample data, and need a SELECT statement to help me identify the point at which I've highlighted the data : Season, Competition, home_team_id, away_team_id, home_user_id, away_user_id, last_changed 1, 18, 11, 23, 3, 2010-11-14 17:18:17 1, 11, 8, 3, 82, 2010-11-14

RE: SELECT Help

2011-02-03 Thread Travis Ard
as user_id, last_changed from data) s1 where s1.user_id = 3 group by team_id, user_id; -Travis -Original Message- From: Tompkins Neil [mailto:neil.tompk...@googlemail.com] Sent: Thursday, February 03, 2011 6:34 AM To: [MySQL] Subject: SELECT Help Hi, I've the following list of sample data

Re: SELECT help.

2006-01-06 Thread Richard Reina
] To: mysql@lists.mysql.com Sent: Thursday, January 05, 2006 10:29 AM Subject: SELECT help. Can someone help me write a query to tell me the customer numbers (C_NO) of those who've had more than 4 transactions but none in the last 6 months? | transactions_table

SELECT help.

2006-01-05 Thread Richard Reina
Can someone help me write a query to tell me the customer numbers (C_NO) of those who've had more than 4 transactions but none in the last 6 months? | transactions_table | | ID|C_NO|DATE | AMOUT| |2901| 387|2003-10-09|

Re: SELECT help.

2006-01-05 Thread Rhino
- Original Message - From: Richard Reina [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Thursday, January 05, 2006 10:29 AM Subject: SELECT help. Can someone help me write a query to tell me the customer numbers (C_NO) of those who've had more than 4 transactions but none

Re: SELECT help.

2006-01-05 Thread Richard Reina
3.23.54 Thanks. Rhino [EMAIL PROTECTED] wrote: - Original Message - From: Richard Reina To: Sent: Thursday, January 05, 2006 10:29 AM Subject: SELECT help. Can someone help me write a query to tell me the customer numbers (C_NO) of those who've had more than 4 transactions

Re: SELECT help.

2006-01-05 Thread SGreen
/05/2006 10:43:15 AM: - Original Message - From: Richard Reina [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Thursday, January 05, 2006 10:29 AM Subject: SELECT help. Can someone help me write a query to tell me the customer numbers (C_NO) of those who've had more than

Re: SELECT help.

2006-01-05 Thread Michael Stassen
Richard Reina wrote: Can someone help me write a query to tell me the customer numbers (C_NO) of those who've had more than 4 transactions but none in the last 6 months? transactions_table | ID | C_NO |DATE | AMOUT | | 2901 | 387 | 2003-10-09 | 23.00 | Obviously my

Re: SELECT help.

2006-01-05 Thread James Harvard
This should work: select c_name, count(t1.id) as t_count from customers c inner join transactions t1 on c.c_no = t1.c_no left join transactions t2 on c.c_no = t2.c_no and t2.date '2005-06-05' where t2.id is null group by c.c_no having t_count 4; There may be more efficient way of doing this

Re: SELECT help.

2006-01-05 Thread Peter Brawley
Richard, Can someone help me write a query to tell me the customer numbers (C_NO) of those who've had more than 4 transactions but none in the last 6 months? Something like this? SELECT c_no, COUNT(c_no) AS cnt FROM transactions_table WHERE NOT EXISTS ( SELECT c_no FROM

SELECT help

2005-03-28 Thread Grant Giddens
Hi, I am tring to do a select from 2 tables. Table1: sku title Table 2: sku feature SELECT table1.title, table2.feature FROM table1, table2 WHERE table1.sku in ($sku1, $sku2, $sku3) ORDER BY FIELD(table1.sku, $sku1, $sku2, $sku3) ASC That seems to work to some extint, but I am getting way

Re: SELECT help

2005-03-28 Thread Eamon Daly
/ Eamon Daly - Original Message - From: Grant Giddens [EMAIL PROTECTED] To: mysql@lists.mysql.com Sent: Monday, March 28, 2005 6:00 PM Subject: SELECT help Hi, I am tring to do a select from 2 tables. Table1: sku title Table 2: sku feature

Re: SELECT help

2005-03-28 Thread beacker
Gran Giddens writes: SELECT table1.title, table2.feature FROM table1, table2 WHERE (table1.sku = $table2.sku) AND table1.sku in ($sku1, $sku2, $sku3) ORDER BY FIELD(table1.sku, $sku1, $sku2, $sku3) ASC ... How can I run my query to get 3 results and if the feature is missing still return the

Select help

2004-07-01 Thread rmck
Hi, I have a table with ip,port and I want to see the top ten Ip's with the most entries? Ip's can be in db many times... Not the first distinct 10... Im stuck... I have tried: mysql select DISTINCT ip from iptable limit 10;

RE: Select help

2004-07-01 Thread Matt Eaton
: Select help Hi, I have a table with ip,port and I want to see the top ten Ip's with the most entries? Ip's can be in db many times... Not the first distinct 10... Im stuck... I have tried: mysql select DISTINCT ip from iptable limit 10; +---+ | ip

Re: Select help

2004-07-01 Thread gerald_clark
select count(*) as cnt group by ip order by cnt desc limit 10; rmck wrote: Hi, I have a table with ip,port and I want to see the top ten Ip's with the most entries? Ip's can be in db many times... Not the first distinct 10... Im stuck... I have tried: mysql select DISTINCT ip from iptable limit

RE: Select help

2004-07-01 Thread Matt Eaton
01, 2004 1:03 PM To: [EMAIL PROTECTED] Subject: Select help Hi, I have a table with ip,port and I want to see the top ten Ip's with the most entries? Ip's can be in db many times... Not the first distinct 10... Im stuck... I have tried: mysql select DISTINCT ip from iptable limit 10

Re: Select help

2004-07-01 Thread Garth Webb
On Thu, 2004-07-01 at 10:03, rmck wrote: Hi, I have a table with ip,port and I want to see the top ten Ip's with the most entries? Ip's can be in db many times... Not the first distinct 10... Im stuck... I have tried: mysql select DISTINCT ip from iptable limit 10;

Re: SQL SELECT HELP

2004-05-03 Thread zoltan . gyurasits
Hi, Ok. This is good!! Thank you! Zoli Egor Egorov [EMAIL PROTECTED] 2004-04-30 03:30 PM To: [EMAIL PROTECTED] cc: (bcc: Zoltan Gyurasits/GYO/COMP/PHILIPS) Subject:Re: SQL SELECT HELP Classification: [EMAIL PROTECTED] wrote

Re: SQL SELECT HELP

2004-04-30 Thread Egor Egorov
[EMAIL PROTECTED] wrote: Sorry. My english is not so good. :( I try to explain. I have table1 : ID value -- 1 100 1 101 1 102 1 200 2 100 2 300--- 2 310 | 3 100 |

SELECT HELP

2004-04-30 Thread Andre MATOS
Hi, Is it possible to create a Select performing a math formula? For example: First I need to add two values come from the same table but from different records. The result will be divided from one number got from another table. Now, the new result will be added with another value got from

Re: SELECT HELP

2004-04-30 Thread Thomas Spahni
Andre, have a look at JOIN. This can solve your problem. Thomas Spahni On Fri, 30 Apr 2004, Andre MATOS wrote: Is it possible to create a Select performing a math formula? For example: First I need to add two values come from the same table but from different records. The result will be

Re: SELECT HELP

2004-04-30 Thread Robert J Taylor
Andre MATOS wrote: Hi, Is it possible to create a Select performing a math formula? For example: First I need to add two values come from the same table but from different records. The result will be divided from one number got from another table. Now, the new result will be added with

Re: SELECT HELP

2004-04-30 Thread Andre MATOS
Hi Robert, the criteria for the record_1 and record_15 is that both are in the same table, but in different records and to find each one it is necessary to perform a WHERE clause. Let's I give you the real example: My problem is while inserting a new record in my table named

Re: SQL SELECT HELP

2004-04-29 Thread zoltan . gyurasits
the value 300. Michael Stassen [EMAIL PROTECTED] 2004-04-28 06:13 PM To: Zoltan Gyurasits/GYO/COMP/[EMAIL PROTECTED] cc: [EMAIL PROTECTED] Subject:Re: SQL SELECT HELP Classification: I'm afraid I don't understand. From your first

Re: SQL SELECT HELP

2004-04-29 Thread Nitin
it, if it does (or doesn't) let me know Regards Nitin - Original Message - From: [EMAIL PROTECTED] To: Michael Stassen [EMAIL PROTECTED] Cc: [EMAIL PROTECTED] Sent: Thursday, April 29, 2004 1:15 PM Subject: Re: SQL SELECT HELP Hi, Sorry. My english is not so good. :( I try to explain. I

Re: SQL SELECT HELP

2004-04-29 Thread zoltan . gyurasits
:Re: SQL SELECT HELP Classification: I hope it should work: Select table1.ID from table1 left join table2 on table1.value=table2.value where table2.value is null OR if you want distinct IDs Select distinct table1.ID from table1 left join table2 on table1.value=table2.value

SQL SELECT HELP

2004-04-28 Thread zoltan . gyurasits
Hi, I have a query problem. I want to make a query SELECT* FROM table1 INNER JOIN table2 ON table1.id NOT IN table2.id But I can't use the NOT IN expression here. What can i do? I have the MySQL version 4.x I can't use subquery :( Thank you in advanced, Zoli

Re: SQL SELECT HELP

2004-04-28 Thread Egor Egorov
[EMAIL PROTECTED] wrote: I have a query problem. I want to make a query SELECT* FROM table1 INNER JOIN table2 ON table1.id NOT IN table2.id But I can't use the NOT IN expression here. What can i do? I have the MySQL version 4.x I can't use subquery :( If I've got you

Re: SQL SELECT HELP

2004-04-28 Thread zoltan . gyurasits
) Subject:Re: SQL SELECT HELP Classification: [EMAIL PROTECTED] wrote: I have a query problem. I want to make a query SELECT* FROM table1 INNER JOIN table2 ON table1.id NOT IN table2.id But I can't use the NOT IN expression here. What can i do? I

Re: SQL SELECT HELP

2004-04-28 Thread Michael Stassen
I'm afraid I don't understand. From your first message, it appears you want a list of rows from table1 whose ids do not appear in table2. The query Egor sent you does just that. Did you try it? If, as you say here, that isn't what you want, could you please describe what you do want?

select help - multiple where/limits

2004-03-18 Thread Kris Burford
hi wondering whether someone can set me straight on whether it's possible to request a set of records from a single table with multiple conditions. for instance, a story table, containing id, title, text, section and published_date. what i would like is to retrieve is the 5 most recently

Re: select help - multiple where/limits

2004-03-18 Thread Victoria Reznichenko
Kris Burford [EMAIL PROTECTED] wrote: hi wondering whether someone can set me straight on whether it's possible to request a set of records from a single table with multiple conditions. for instance, a story table, containing id, title, text, section and published_date. what i would

Re: SQL select help required please

2004-02-02 Thread Matthew Stuart
I am trying to create a html search results page with the following: SELECT * FROM tbl_allarticles WHERE (fld_headline LIKE'%userinput%' OR fld_summary LIKE'%userinput%' OR fld_body LIKE'%userinput%') AND fld_category LIKE 'catvalue' The above works fine, but the below code is giving me some

SQL select help required please

2004-02-01 Thread Matthew Stuart
I am trying to create a html search results page with the following: SELECT * FROM tbl_allarticles WHERE (fld_headline LIKE'%userinput%' OR fld_summary LIKE'%userinput%' OR fld_body LIKE'%userinput%') AND fld_category LIKE 'catvalue' The above works fine, but the below code is giving me some

Re: SQL select help required please

2004-02-01 Thread Daniel Kasak
Matthew Stuart wrote: I am trying to create a html search results page with the following: SELECT * FROM tbl_allarticles WHERE (fld_headline LIKE'%userinput%' OR fld_summary LIKE'%userinput%' OR fld_body LIKE'%userinput%') AND fld_category LIKE 'catvalue' The above works fine, but the below

Select help

2004-01-23 Thread Mike Mapsnac
Hello I want to select from the table sum of logins for each day. For example: Date Logins 2004-01-22 10 2004-01-23 12 Any ideas if such select is possible? +--+--+ | Field| Type |

Re: Select help

2004-01-23 Thread Aleksandar Bradaric
Hi, I want to select from the table sum of logins for each day. Would this help: mysql select date_format(your_date_column, %Y-%m-%d), count(*) - from your_table - group by date_format(your_date_column, %Y-%m-%d); Take care, Aleksandar -- MySQL General Mailing List For list

Re: Select help

2004-01-23 Thread Mikael Fridh
- Original Message - From: Mike Mapsnac [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, January 23, 2004 11:42 PM Subject: Select help Hello I want to select from the table sum of logins for each day. Here's one way to do it. SELECT SUBSTRING(last_login, 1, 10) AS day

SELECT help

2003-07-18 Thread Gyurasits Zoltan
HI all! I want make the SELECT for this situation. Example: Twarehouse -- IDname --- 01Spring_WH 02Screw_WH 03Toll_WH Tparts -- IDname --- 01M3 screw 02

RE: SELECT help

2003-07-18 Thread Cabanillas Dulanto, Ulises
) inner join twarehouse b on ( tmovement.outgoing_id = b.Id ) Ulises -Mensaje original- De: Gyurasits Zoltan [mailto:[EMAIL PROTECTED] Enviado el: Martes 18 de Febrero de 2003 04:11 PM Para: MYSQL Lista Asunto: SELECT help HI all! I want make the SELECT

Re: SELECT help

2003-07-18 Thread Gyurasits Zoltan
Hi This is working... Thank You Zoltan - Original Message - From: Cabanillas Dulanto, Ulises [EMAIL PROTECTED] To: MYSQL Lista [EMAIL PROTECTED] Sent: Friday, July 18, 2003 10:54 PM Subject: RE: SELECT help Try with : SELECT tparts.name, a.name

select help

2003-07-06 Thread Dan Cox
Hello list, I'm really new to mysql and databases in general. I have a select form that contains a very long list of options, and what I want to do is store the selected item as a number instead of the items name in order to speed up searches. My problem comes when a search is done and I can't

Re: select help

2003-07-06 Thread Todd O'Bryan
I'm new, too, so someone correct me if I'm wrong, but... if you make it an ENUM field in a table you can store it using the value in the selection, retrieve it as the same value, and still get all the advantages of numeric storage. Todd On Sunday, July 6, 2003, at 02:38 PM, Dan Cox wrote:

Re: select help

2003-07-06 Thread mtoth
Another option is to have another table with the item name and number using that as a lookup table. IMHO it all depends on the data if the select is static (or rarely changes) an enum would be best. If is changes a lot then I would use another table to store it in. -Michael I protect you,

select help

2003-04-02 Thread John Hoskins
Please consider the following two tables: mysql select * from os_table; +---+--+ | os_id | os_name | +---+--+ | 1 | mac os | | 2 | win 95 | | 4 | win 98 | | 8 | win nt | |16 | win 2000 | |32 | win me | |64 | xp home | | 128 | xp

RE: select help

2003-04-02 Thread Michael Shulman
mysql select solution - from os_table os, solutions_table solutions - where os.os_id = solutions.os_code - and os.os_id = 8; -ms -Original Message- From: John Hoskins [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 10:41 AM To: [EMAIL PROTECTED] Subject: select

RE: select help

2003-04-02 Thread John Hoskins
solutions - where os.os_id = solutions.os_code - and os.os_id = 8; -ms -Original Message- From: John Hoskins [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 10:41 AM To: [EMAIL PROTECTED] Subject: select help Please consider the following two tables

RE: select help

2003-04-02 Thread Michael Shulman
: select help Not quite that simple, Plese read the last of the original post. I need all solutions that have the 4th bit on, so 8,15,24,31...255 all have the 4th bit in combination with other bits. On Wed, 2 Apr 2003, Michael Shulman wrote: mysql select solution - from os_table os

RE: select help

2003-04-02 Thread Michael Shulman
Hoskins' Cc: '[EMAIL PROTECTED]' Subject: RE: select help No problem. Use mod(m,n). To get the records where the 8 bit is set, use and mod(os.os_id,8) = 0; mysql use test Database changed mysql create table t (i integer); Query OK, 0 rows affected (0.18 sec) mysql insert into t values (1

RE: select help

2003-04-02 Thread John Hoskins
: Michael Shulman [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 11:38 AM To: 'John Hoskins' Cc: '[EMAIL PROTECTED]' Subject: RE: select help No problem. Use mod(m,n). To get the records where the 8 bit is set, use and mod(os.os_id,8) = 0; mysql use test Database changed mysql

RE: select help

2003-04-02 Thread Jeff Shapiro
-Original Message- From: Michael Shulman [mailto:[EMAIL PROTECTED] Sent: Wednesday, April 02, 2003 11:38 AM To: 'John Hoskins' Cc: '[EMAIL PROTECTED]' Subject: RE: select help No problem. Use mod(m,n). To get the records where the 8 bit is set, use and mod(os.os_id,8) = 0

Re: select help

2003-04-02 Thread Bruce Feist
Jeff Shapiro wrote: If you want to be a bit more generic you could do something like this: # store the desired OS ID into a variable SELECT @desired_id := os_id FROM os_table WHERE os_name = win nt; # now find the solutions that match with the os_id SELECT o.os_id, o.os_name, s.os_code,

select help

2003-02-26 Thread John Hoskins
Probably a simple query but, I need to find select a field with data that exists in one table but does not exist in a field in another table. example: table1.name table2.name --- bob john susan

RE: select help

2003-02-26 Thread Don Read
On 26-Feb-2003 John Hoskins wrote: Probably a simple query but, I need to find select a field with data that exists in one table but does not exist in a field in another table. example: table1.name table2.name --- bob

RE: MySQL: Select HELP!

2002-12-04 Thread Ian Zabel
select * from processo_arquivos order by DATE desc limit 10 -Original Message- From: Felipe Moreno - MAILING LISTS [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 03, 2002 12:42 PM To: [EMAIL PROTECTED] Subject: MySQL: Select HELP! Importance: High Hi List Users, I want to know

MySQL: Select HELP!

2002-12-03 Thread Felipe Moreno - MAILING LISTS
Hi List Users, I want to know if anyone has any idea on how can I do the SQL command below to archive a result. I have one table called processo_arquivos that have a filed called DATE and another FIELD called COD (primary key). I want to select the last TEN (10) dates from the Database, but

RE: MySQL: Select HELP!

2002-12-03 Thread Adolfo Bello
SELECT * FROM processo_arquivos ORDER BY DATE DESC LIMIT 0,10 -Original Message- From: Felipe Moreno - MAILING LISTS [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 03, 2002 1:42 PM To: [EMAIL PROTECTED] Subject: MySQL: Select HELP! Importance: High Hi List Users, I

Re: MySQL: Select HELP!

2002-12-03 Thread Alex Pukinskis
Try this: SELECT DATE, COD FROM processo_arquivos ORDER BY DATE DESC LIMIT 10 Unfortunately, that puts them in reverse order. There's probably a better way, with a more sophisticated use of the LIMIT keyword, that puts them in the right order. -Alex On Tuesday, December 3, 2002, at 10:41

SELECT HELP

2001-12-18 Thread *Himerus*
How do I use the select feature in this situation. I have a total of 5 fields that deal with names.. Three of the five are completely separate, and use one field for both first and last name. the last two fields are the first and last name of the person submitting the information.. When I

RE: SELECT HELP

2001-12-18 Thread P
: *Himerus* [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 18, 2001 10:09 PM To: [EMAIL PROTECTED] Subject: SELECT HELP How do I use the select feature in this situation. I have a total of 5 fields that deal with names.. Three of the five are completely separate, and use one field for both

Re: SELECT help

2001-03-22 Thread Bob Hall
Hi, This is my first posting, although i've been signed up to the list for a while. My problem is this. Table A (5000 rows) ID, NAME, SCORE Table B (1000 rows) ID, NAME, SCORE I want all records from Table A and those from Table B where they match, for this i'm using a right join. However,

SELECT help

2001-03-20 Thread Ben Smith
Hi, This is my first posting, although i've been signed up to the list for a while. My problem is this. Table A (5000 rows) ID, NAME, SCORE Table B (1000 rows) ID, NAME, SCORE I want all records from Table A and those from Table B where they match, for this i'm using a right join. However,

Re: SELECT help

2001-02-15 Thread Bob Hall
Sir, haven't you posted this before? It looks familiar. You can't apply an aggregate function to an entire table if the SELECT statement has a GROUP BY clause. The aggregate function will return totals for the groups, not for the entire table. Bob Hall Can someone help me combine this

SELECT help

2001-02-14 Thread nick
Can someone help me combine this statement ... SELECT d.*, b.invoice_id FROM domain_info d LEFT JOIN billing_info b ON d.domain_id=b.domain_id WHERE billing_cycle = '12' OR billing_cycle = 'Z' OR billing_cycle = 'C' GROUP BY domain_name with this statement ... SELECT sum(ammount_due) FROM

select HELP from HERE where HELP_NEEDED = TRUE !

2001-01-22 Thread Amir
hi, i have a web serverrunning redhat linux 7 i installed mysql 3.23.30 two weeks ago and it has begun to cause problems i get a "lost connection during query" every half a minute, basicly my web site is dead i tried instaling the 3.23.32 ( stable you call it! ) and i get the same response i'm in