Re: SQL select basics

2008-10-20 Thread Moon's Father
select * from ( SELECT ID_number, count( CU_number ) AS CC FROM MyTable GROUP BY ID_number ) T WHERE CC = ( select max(cc) from ( SELECT ID_number, count( CU_number ) AS CC FROM MyTable GROUP BY ID_number ) T2 ) On Wed, Oct 15, 2008 at 5:08 PM, dave aptiva <[EMAIL PROTECTED]>wrote: > Hello a

Re: SQL select basics

2008-10-17 Thread Jim Lyons
SELECT ID_number, count( CU_number ) FROM MyTable GROUP BY ID_number order by 2 desc limit 10 will give you the top 10. Change 10 to whatever you want or take off the limit clause to get all records. On Fri, Oct 17, 2008 at 4:25 AM, dave aptiva <[EMAIL PROTECTED]>wrote: > Hello all, > > I'm new

SQL select basics

2008-10-17 Thread dave aptiva
Hello all, I'm new to sql and have a question if someone would be kind enough to help me with, if I have a table that stores telemarketers by ID_number and the customer that they spoke to by CU_number and I use a select statement such as; SELECT ID_number, count( CU_number ) FROM MyTable G

Re: SQL select basics

2008-10-17 Thread Ian Christian
2008/10/17 dave aptiva <[EMAIL PROTECTED]>: > > I tried SELECT ID_number, max( count( CU_number ) ) but this causes an error > "# - Invalid use of group function " # sqlite3 SQLite version 3.5.9 Enter ".help" for instructions sqlite> create table moo (id_number, cu_number); sqlite> insert int

SQL select basics

2008-10-17 Thread dave aptiva
Hello all, I'm new to sql and have a question if someone would be kind enough to help me with, if I have a table that stores telemarketers by ID_number and the customer that they spoke to by CU_number and I use a select statement such as; SELECT ID_number, count( CU_number ) FROM MyTable G

Re: A sql/select question.

2008-02-18 Thread King C. Kwok
Hi Rob, That is just what I need. I can't use 'join' very well yet. Thank you very much. -- King Kwok -- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]

Re: A sql/select question.

2008-02-18 Thread Rob Wultsch
2008/2/18 King C. Kwok <[EMAIL PROTECTED]>: > table users > > iduser_iduser_name > 1 M11 Shirley > 2 M12 Bruce > 3 M13 Fred > 4 M14 Albert > 5 M15 Elizabeth > 6 T11 Helen > 7 T12 Tracy > 8 T13

A sql/select question.

2008-02-18 Thread King C. Kwok
table users iduser_iduser_name 1 M11 Shirley 2 M12 Bruce 3 M13 Fred 4 M14 Albert 5 M15 Elizabeth 6 T11 Helen 7 T12 Tracy 8 T13 Charles 9 T14 Jack 10 T15 Ann table jo

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 PRO

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 10

Re: SQL SELECT HELP

2004-04-29 Thread zoltan . gyurasits
gt; cc: <[EMAIL PROTECTED]> Subject: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 f

Re: SQL SELECT HELP

2004-04-29 Thread Nitin
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, > >

Re: SQL SELECT HELP

2004-04-29 Thread zoltan . gyurasits
ing 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 und

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? Michae

Re: SQL SELECT HELP

2004-04-28 Thread zoltan . gyurasits
urasits/GYO/COMP/PHILIPS) 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

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

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 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 ji

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 cod

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 jip

SQL select

2003-10-05 Thread Jiří Němec
2 hthomas 1 3 upeter messages 1 bla1 1 u 2 h 2003-10-02 15:00:00 2 bla2 2 h 1 u 2003-10-02 15:00:20 3 bla3 3 u 1 u 2003-10-02 15:00:40 4 bla4 2 h 1 u 2003-10-02 15:01:05 I need in one SQL select, if is possible, get all records

Re: Funny behaviour with '?' - SQL, SELECT

2003-09-18 Thread Victoria Reznichenko
"Franz, Fa. PostDirekt MA" <[EMAIL PROTECTED]> wrote: > > I tried > SELECT * FROM WHERE LIKE '%?%'; > to find out if german umlauts (???) are imported. > > In the resultset where some ds with '?' and some with 'y'. > So the charset itself seems to be OK but why did I get 'y'. > They sound some

Funny behaviour with 'ü' - SQL, SELECT

2003-09-17 Thread Franz, Fa. PostDirekt MA
Dear Ladies and Sirs, I tried SELECT * FROM WHERE LIKE '%ü%'; to find out if german umlauts (öäü) are imported. In the resultset where some ds with 'ü' and some with 'y'. So the charset itself seems to be OK but why did I get 'y'. They sound sometimes the same, but they are not the same. How c

Funny behaviour with 'ü' - SQL, SELECT

2003-09-17 Thread Franz, Fa. PostDirekt MA
Dear Ladies and Sirs, I tried SELECT * FROM WHERE LIKE '%ü%'; to find out if german umlauts (öäü) are imported. In the resultset where some ds with 'ü' and some with 'y'. So the charset itself seems to be OK but why did I get 'y'. They sound sometimes the same, but they are not the same. How c

Re: sql select from question

2003-02-24 Thread Veysel Harun Sahin
Thanks dread. Yes it can be done programmatically. But i try to do only with sql. I don't want to hardcode it. [EMAIL PROTECTED] wrote: On 24-Feb-2003 Veysel Harun Sahin wrote: Hello list, I want to select all the columns in a table except one column. Can I do this without writing all the c

RE: sql select from question

2003-02-24 Thread Don Read
On 24-Feb-2003 Veysel Harun Sahin wrote: > Hello list, > > I want to select all the columns in a table except one column. Can I do > this without writing all the column names to the query? For example > assume that I have table with the name table1 and there are 50 columns > in table1 with the

sql select from question

2003-02-24 Thread Veysel Harun Sahin
Hello list, I want to select all the columns in a table except one column. Can I do this without writing all the column names to the query? For example assume that I have table with the name table1 and there are 50 columns in table1 with the names col1, col2, col3.col50. To be able to sele

RES: SQL Select Idea [ORDER BY]

2002-12-06 Thread Felipe Moreno - MAILING LISTS
but I just saw apllacation using the update command. Well, any new ideas? Best Regards, Felipe -Mensagem original- De: Michael T. Babcock [mailto:[EMAIL PROTECTED]] Enviada em: quinta-feira, 5 de dezembro de 2002 21:03 Para: [EMAIL PROTECTED] Assunto: Re: SQL Select Idea [ORDER BY] O

Re: SQL Select Idea [ORDER BY]

2002-12-05 Thread Michael T. Babcock
On Thu, Dec 05, 2002 at 08:54:29PM -0200, Felipe Moreno - MAILING LISTS wrote: > > Well, could you explain the behave of ORDER BY DATE,COD? Just try it (it will order by date, then cod). What I think you want is (as I originally said, but briefly): create temporary table top10 select * from ..

RES: SQL Select Idea [ORDER BY]

2002-12-05 Thread Felipe Moreno - MAILING LISTS
ten dates). So, >what I really need ia an way to make a select without any "data" from the >DB. I tried to use de LAST_INDEX() function to do this but I didn't go >anywhere. Any ideas??? -Mensagem original- De: Michael T. Babcock [mailto:[EMAIL PROTECTED]] Enviada em: quinta-feira,

Re: SQL Select Idea [ORDER BY]

2002-12-05 Thread Michael T. Babcock
On Thu, Dec 05, 2002 at 09:41:24AM -0200, Felipe Moreno - MAILING LISTS wrote: >The ten last dates appear as a default result of a Archives page. When I > enter for the first time in the page, it give me the last ten Files that was > uploaded. In the same page, I can ORDER BY the ten last dates

RES: RES: RES: SQL Select Idea

2002-12-05 Thread Felipe Moreno - MAILING LISTS
: SQL Select Idea On Wed, Dec 04, 2002 at 08:55:51AM -0200, Felipe Moreno - MAILING LISTS wrote: >Well, the SQL Query you requested is exatcly the one I'm asking! :-) No; I want to know what you intended for those 10 dates to do. The LIMIT query worked, as posted by someone else, w

Re: RES: RES: SQL Select Idea

2002-12-04 Thread Michael T. Babcock
On Wed, Dec 04, 2002 at 08:55:51AM -0200, Felipe Moreno - MAILING LISTS wrote: >Well, the SQL Query you requested is exatcly the one I'm asking! :-) No; I want to know what you intended for those 10 dates to do. The LIMIT query worked, as posted by someone else, which you quoted. What do you

RES: RES: SQL Select Idea

2002-12-04 Thread Felipe Moreno - MAILING LISTS
e the last ten dates. $sql = "select pa.codigo,arquivo,label,tipo,DATE_FORMAT(data,'%d/%m/%Y - %H:%i') as ndata,RS,ref_wicie from processo_arquivos as pa,cliente as c,processo as p where pa.codigocliente=c.codigo and pa.codigoprocesso=p.codigo "; // This is th

RES: RES: SQL Select Idea

2002-12-04 Thread Felipe Moreno - MAILING LISTS
zembro de 2002 01:03 Para: Felipe Moreno - MAILING LISTS Assunto: Re: RES: SQL Select Idea Felipe - Maybe you could... (1) Put the first result set into a temp table, on which you could execute subsequent queries, or (2) Use php to construct an array of the result rows, and then use php's arra

Re: RES: SQL Select Idea

2002-12-03 Thread Michael T. Babcock
On Tue, Dec 03, 2002 at 07:02:02PM -0200, Felipe Moreno - MAILING LISTS wrote: > 2) What I get is I use the SELECT * FROM processo_arquivos ORDER BY DATE > DESC LIMIT 0,3 (considering that I only want 3) [ that worked as described ] > 3) The problem getting the result like this: > > Since I have

RE: SQL Select Idea

2002-12-03 Thread Jim Esten
ED]] Sent: Tuesday, December 03, 2002 10:39 AM To: [EMAIL PROTECTED] Subject: SQL Select Idea Importance: High 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 calle

RES: SQL Select Idea

2002-12-03 Thread Felipe Moreno - MAILING LISTS
---Mensagem original- De: Jim Esten [mailto:[EMAIL PROTECTED]] Enviada em: terça-feira, 3 de dezembro de 2002 17:40 Para: 'Felipe Moreno - MAILING LISTS'; [EMAIL PROTECTED] Assunto: RE: SQL Select Idea Something on the order of... SELECT * FROM processo_arquivos ORDER BY DATE DESC LIMIT

RE: SQL Select Idea

2002-12-03 Thread Jim Esten
, December 03, 2002 10:39 AM To: [EMAIL PROTECTED] Subject: SQL Select Idea Importance: High 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

RE: SQL Select Idea

2002-12-03 Thread Mike Hillyer
I believe that SELECT * FROM processo_arquivos ORDER BY date DESC LIMIT 10; Should do it. Mike Hillyer -Original Message- From: Felipe Moreno - MAILING LISTS [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 03, 2002 9:39 AM To: [EMAIL PROTECTED] Subject: SQL Select Idea Importance

SQL Select Idea

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: sql-select

2002-08-27 Thread Mikhail Entaltsev
t;[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, August 27, 2002 12:31 PM Subject: sql-select > Hello, > > I have a small(hopefully) sql-query problem. > I have 2 table like this: > > Table member: > > Id number, > Name varchar, > > Table mem

sql-select

2002-08-27 Thread Stefan Sturm
Hello, I have a small(hopefully) sql-query problem. I have 2 table like this: Table member: Id number, Namevarchar, Table member_points: Id number Member__id number (fk from member_table) Round number Points number Now one example: In table one is a membe

Re: SQL select rows conditional on same select

2002-07-10 Thread Carl Franks
Thanks Chuck! The last example you gave looked just right, but when I ran it, it returned an error. A quick look at the mysql manual revealed that UNION SELECTs are on the TO DO list for mysql :( With the examples you provided though, I was able to create the following statement which returns ex

SQL select rows conditional on same select

2002-07-09 Thread Carl Franks
Hi, I have 2 tables, "X" and "Y". table X table Y ++---+ ++---+ | id | title | | id | assoc | ++---+ ++---+ | 1 | one | | 1 | 3 | | 2 | two | | 2 | 3 | | 3 | three | | 2 | 4 | | 4 | four | ++---+ | 5 | five

Re: Sql SELECT statement to get all dates between 7:00am yesterday an d 7:00am today

2002-04-27 Thread Benjamin Pflugmann
e I need to select all records between yesterday at 7:00am and today at > 7:00am. Obviously this can be run at any time or day. This has to be a very > common sql SELECT statement, but for the life of me I can't find anything. > I'm either not doing the right google search or look

RE: Sql SELECT statement to get all dates between 7:00am yesterday an d 7:00am today

2002-04-25 Thread Whitlow, Don
e <= concat(date_format(now(),'%Y-%m-%d'), ' 07:00:00') order by startdate; This gets me everything between 7:00am yesterday and 7:00am today. Thanks! Don -Original Message- From: Gordon Stewart [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 9:08 AM To

RE: Sql SELECT statement to get all dates between 7:00am yesterday an d 7:00am today

2002-04-25 Thread Whitlow, Don
Hi, Yes, one column is dedicated to date/time for each record. Data type on that column is MySQL's datetime type. Don -Original Message- From: Gordon Stewart [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 9:08 AM To: [EMAIL PROTECTED] Subject: Re: Sql SELECT statement t

Re: Sql SELECT statement to get all dates between 7:00am yesterday an d 7:00am today

2002-04-25 Thread Gordon Stewart
At 08:22 25/04/02 -0500, you wrote: >Hi Everyone, > >I am very new to database programming, and am working on an application >where I need to select all records between yesterday at 7:00am and today at >7:00am. Obviously this can be run at any time or day. This has to be a very >

Sql SELECT statement to get all dates between 7:00am yesterday and 7:00am today

2002-04-25 Thread Whitlow, Don
Hi Everyone, I am very new to database programming, and am working on an application where I need to select all records between yesterday at 7:00am and today at 7:00am. Obviously this can be run at any time or day. This has to be a very common sql SELECT statement, but for the life of me I can&#

with sql select statement from mysql ??

2002-01-11 Thread Investor
le\n"; undef $sql; $sql = " select * from regs "; if ($db->Sql($sql)){ print "SQL failed.\n"; print "Error: " . $db->Error() . "\n"; $db->Close(); exit; } print file " refcite

A simple SQL SELECT

2001-07-16 Thread Jeff S Wheeler
[This is an email copy of a Usenet post to "mailing.database.mysql"] Martin, Here is how you can do what you want using a temporary table. Note that using this method, if you have two guys who play the same position, and they have an equal number of points, it'll select both records. mysql> CR

Re: Asking help about SQL(Select)

2001-02-05 Thread Rus
select name,(Cashincome+transaction_income) as Income from TableA; - Original Message - From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, February 05, 2001 5:04 PM Subject: Asking help about SQL(Select) Dear All, Sorry for bothering everyone. I am just

Asking help about SQL(Select)

2001-02-05 Thread Dart
Dear All, Sorry for bothering everyone. I am just working with MySQL but I have faced a problem: I have a table with following problems: TableA with following columns: NameCashincome transaction_income I cannot change the form of table. If i wanna to have suc