osdir.com
mailing list archive

Subject: Re: Bad query structure... - msg#00129

List: db.mysql.windows

Date: Prev Next Index Thread: Prev Next Index
> I am trying to identify items with no records in a sub-set, such as a
customer
> with no purchases. I have tried several different queries but none
provide
> the correct result set, eq:
>
> SELECT Count(P.Ref)=0, C.Ref, C.Surname, C.Forename FROM Clients C JOIN
> Purchases P ON C.Ref=P.Ref

SELECT Count(P.Ref) as Counter, C.Ref, C.Surname, C.Forename FROM Clients C
JOIN
Purchases P ON C.Ref=P.Ref WHERE Counter=0 GROUP BY C.Ref


Petr Vileta, Czech republic


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@xxxxxxxxxxx




Was this page helpful?
Yes No
Thread at a glance:

Previous Message by Date: click to view message preview

Re: Bad query structure...

I can almost guess an answer based on you sample query. Please post your table structures and we will get it right the first time (SHOW CREATE TABLE xxxx). Yours, Shawn Green Database Administrator Unimin Corporation - Spruce Pine ian_t_howarth@xxxxxxxxxxxxx wrote on 07/20/2004 09:24:40 AM: > Hi, > > I am trying to identify items with no records in a sub-set, such as a customer > with no purchases. I have tried several different queries but none provide > the correct result set, eq: > > SELECT Count(P.Ref)=0, C.Ref, C.Surname, C.Forename FROM Clients C JOIN > Purchases P ON C.Ref=P.Ref > > Can anyone provide me with info as to the correct query structure? > > > > TIA > > > __________________________________________________ > Broadband from an unbeatable £15.99! > > http://www.tiscali.co.uk/products/broadband/home.html?code=SM-NL-11AM > > > > > -- > MySQL Windows Mailing List > For list archives: http://lists.mysql.com/win32 > To unsubscribe: http://lists.mysql.com/win32?unsub=sgreen@xxxxxxxxxx >

Next Message by Date: click to view message preview

converting mysql 4.0.20 to UTF-8 and using phpmyadmin to enter utf-8 data.

Dear mailing list, I have been searching forums as well as documentation for information on how to use utf-8 together with mysql 4.0.20 for he last week.I use a unicode editor with which I convert text to Unicode utf-8. After copying these texts and pasting them into phpmyadmin tables, all I see are the numeric values when I browse the tables. I want to use utf-8 for my entire webpage project. All I have found so far is this http://climbtothestars.org/archives/2004/07/18/converting-mysql-database -contents-to-utf-8/ All of the content is ISO-8859-1 I think. But that doesn?t really help me. In a forum somebody told me that the problem is that the phpmyadmin forms send ISO-8859-1 to mysql that is why it is not stored properly. Please could anybody help me with this. I am totally desperate. Thank you very much.

Previous Message by Thread: click to view message preview

Re: Bad query structure...

I can almost guess an answer based on you sample query. Please post your table structures and we will get it right the first time (SHOW CREATE TABLE xxxx). Yours, Shawn Green Database Administrator Unimin Corporation - Spruce Pine ian_t_howarth@xxxxxxxxxxxxx wrote on 07/20/2004 09:24:40 AM: > Hi, > > I am trying to identify items with no records in a sub-set, such as a customer > with no purchases. I have tried several different queries but none provide > the correct result set, eq: > > SELECT Count(P.Ref)=0, C.Ref, C.Surname, C.Forename FROM Clients C JOIN > Purchases P ON C.Ref=P.Ref > > Can anyone provide me with info as to the correct query structure? > > > > TIA > > > __________________________________________________ > Broadband from an unbeatable £15.99! > > http://www.tiscali.co.uk/products/broadband/home.html?code=SM-NL-11AM > > > > > -- > MySQL Windows Mailing List > For list archives: http://lists.mysql.com/win32 > To unsubscribe: http://lists.mysql.com/win32?unsub=sgreen@xxxxxxxxxx >

Next Message by Thread: click to view message preview

Re: Bad query structure...

I tried the suggestion: >SELECT Count(P.Ref) as Counter, C.Ref, C.Surname, C.Forename >FROM Clients C >JOIN Purchases P ON C.Ref=P.Ref >WHERE Counter=0 >GROUP BY C.Ref but I get the message "Unknown column `counter` in `where clause` Any other ideas out there? >-- Original Message -- >From: "Petr Vileta" <petr@xxxxxxxxxxxxx> >To: <win32@xxxxxxxxxxxxxxx> >Subject: Re: Bad query structure... >Date: Tue, 20 Jul 2004 16:21:36 +0200 > > >> I am trying to identify items with no records in a sub-set, such as a >customer >> with no purchases. I have tried several different queries but none >provide >> the correct result set, eq: >> >> SELECT Count(P.Ref)=0, C.Ref, C.Surname, C.Forename FROM Clients C JOIN >> Purchases P ON C.Ref=P.Ref > >SELECT Count(P.Ref) as Counter, C.Ref, C.Surname, C.Forename FROM Clients >C >JOIN >Purchases P ON C.Ref=P.Ref WHERE Counter=0 GROUP BY C.Ref > > >Petr Vileta, Czech republic > > >-- >MySQL Windows Mailing List >For list archives: http://lists.mysql.com/win32 >To unsubscribe: >http://lists.mysql.com/win32?unsub=ian_t_howarth@xxxxxxxxxxxxx > __________________________________________________ Broadband from an unbeatable £15.99! http://www.tiscali.co.uk/products/broadband/home.html?code=SM-NL-11AM -- MySQL Windows Mailing List For list archives: http://lists.mysql.com/win32 To unsubscribe: http://lists.mysql.com/win32?unsub=gcdmw-win32@xxxxxxxxxxx
Sign up for updates to this mailing list. email:
Loading Comments...
Home | News | Patents | Sitemap | FAQ | advertise

Advertising by