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
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
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
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
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]
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
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
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
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
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
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
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
"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
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
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
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
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
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
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 ..
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,
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
: 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
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
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
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
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
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
---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
, 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
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
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
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
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
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
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
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
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
>
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
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
[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
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
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
54 matches
Mail list logo