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
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
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
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
[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
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
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,
>
>
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
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
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
[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
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
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
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
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
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 ..
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
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
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,
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
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
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
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
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
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
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
26 matches
Mail list logo