List:General Discussion« Previous MessageNext Message »
From:kalle volkov Date:April 10 1999 1:43pm
Subject:Re: BUG: query with 'group by' fails to find matching row[s] (fwd)
View as plain text  
hi!

Richard G. Harman Jr wrote:
> select artist,filename from mp3 where full_path like '%mary%' group by
> artist;
---
> and it only returns 2 rows.
---
> I then do,
> select artist,filename from mp3 where full_path like '%mary%';
> and it returns all three.
--- 
> INSERT INTO mp3 VALUES (338,'7_Mary_3-Cumbersome.mp3','/phat/mp3/7_Mary_3/7_Mary
> _3-Cumbersome.mp3','','7 Mary 3','Cumbersome',NULL,3,'Unknown',128,44100,'j-ster
> eo','2',3825997,'fd727b9eae9af280322f9511f3a03151',239);
> INSERT INTO mp3 VALUES (339,'7_Mary_3-Waters_Edge.mp3','/phat/mp3/7_Mary_3/7_Mar
> y_3-Waters_Edge.mp3','','7 Mary 3','Waters Edge',NULL,3,'Unknown',128,44100,'j-s
> tereo','2',3717327,'92b259fe689bec6bcb832cd84c202427',232);
> INSERT INTO mp3 VALUES (576,'Jethro_Tull_Vol_2-Cross_Eyed_Mary.mp3','/phat/mp3/J
> ethro_Tull_Vol_2/Jethro_Tull_Vol_2-Cross_Eyed_Mary.mp3','','Jethro Tull Vol 2','
> Cross Eyed Mary',NULL,3,'Unknown',112,44100,'j-stereo','2',3514276,'dae26ea6415a
> 70c0a7c8f833625da40a',251);

it's quite normal... 

if u group by artists then u have 2 artists:
---
7 Mary 3            (count 2)
Jethro Tull Vol 2   (count 1)
---

if u select all (without group) then u have 3 artists (2 alike and 1
different)
---
7 Mary 3            (count 1)
7 Mary 3            (count 1)
Jethro Tull Vol 2   (count 1)
---

think a little 'bout the group function and then think some more...

regs,
cal6
Thread
BUG: query with 'group by' fails to find matching row[s] (fwd)Richard G. Harman Jr10 Apr
  • Re: BUG: query with 'group by' fails to find matching row[s] (fwd)kalle volkov10 Apr
  • Re: BUG: query with 'group by' fails to find matching row[s] (fwd)Shaun Batterton11 Apr
    • Re: BUG: query with 'group by' fails to find matching row[s] (fwd)Richard G. Harman Jr12 Apr