D&C GLug - Home Page

[ Date Index ] [ Thread Index ] [ <= Previous by date / thread ] [ Next by date / thread => ]

Re: [LUG] SQL query help please

 

> > SELECT COUNT(*) FROM earthquake WHERE cause = 'earthquake';
> > SELECT occured_on, magnitude, place, cause FROM earthquakes ORDER BY magnitude 
> > DESC LIMIT 3;
> >
>
> table earthquake <> earthquakes :-)

That was just a typo in my email! My database uses 'earthquake'
exclusively, and the tutorial uses 'earthquakes'.

With your help on #DCGLUG on IRC, I've managed to fix all the records
now - the dataset is a CSV with CRLF line endings (the tutorial
presenter uses Windows), so there were stray carriage returns when I
imported it with:
>... lines terminated by '\n'

This is why the queries failed - the string lookup needs to be exact.

Anyway, thank you Stinga, and also everyone else who has investigated
this.

Best wishes, Sebastian
Freenode: 'seabass'


-- 
The Mailing List for the Devon & Cornwall LUG
https://mailman.dcglug.org.uk/listinfo/list
FAQ: http://www.dcglug.org.uk/listfaq