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

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

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

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

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

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

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

RE: SQL Select Idea

2002-12-03 Thread Jim Esten
Is anyone else experiencing long delays in posts? I sent this about 5 hours before it posted. Thanks, Jim -Original Message- From: Jim Esten [mailto:[EMAIL PROTECTED]] Sent: Tuesday, December 03, 2002 1:40 PM To: 'Felipe Moreno - MAILING LISTS'; [EMAIL PROTECTED] Subjec

RE: SQL Select Idea

2002-12-03 Thread Jim Esten
Something on the order of... SELECT * FROM processo_arquivos ORDER BY DATE DESC LIMIT 0,10 Seems like that ought to do it.. Jim Jim Esten Chief Techbot WebDynamic http://www.wdynamic.com -Original Message- From: Felipe Moreno - MAILING LISTS [mailto:[EMAIL PROTECTED]] Sent: Tuesday,

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: H

Re: sql-select

2002-08-27 Thread Mikhail Entaltsev
select m.Name, mp1.Points as Round1, mp2.Points as Round2, mp3.Points as Round3, mp4.Points as Round4, mp5.Points as Round5 from member m, member_points mp1, member_points mp2, member_points mp3, member_points mp4, member_points mp5 where m.Id = mp1.Member__id and m.Id = mp2.M

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

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

2002-04-27 Thread Benjamin Pflugmann
Hello. You have given to few information to give a specific answer. Please include the output of "DESC your_table" in your mail next time. Most people probably solve that by determining the date in the application part and just inserting it in the SQL query. The following is an SQL-only solution

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 >common sql SELECT