[Binari] Sql stuff

Hey, can somebody point out what is wrong with this query? I do not really see anything wrong with the syntax, but apparently, there is :( SELECT `common_name`, `type`, count(`gene_id`) AS `count` FROM `annotation` WHERE `species`='ath' JOIN annot_sources ON annotation.source_key = annot_sources.pkey GROUP BY source_key,type; Sql is complaining about the syntax, so you can assume that all the table and column names are correct. Michiel PS: The winner can go get a free hotdog downstairs :p -- ================================================================== Michiel Van Bel PhD student Tel:+32 (0)9 331 36 95 fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, Ghent University Technologiepark 927, 9052 Gent, BELGIUM mibel@psb.ugent.be http://www.psb.ugent.be ==================================================================

ok problem solved, apparently i've been sleeping through the DB-practice sessions :D Michiel Van Bel wrote:
Hey,
can somebody point out what is wrong with this query? I do not really see anything wrong with the syntax, but apparently, there is :(
SELECT `common_name`, `type`, count(`gene_id`) AS `count` FROM `annotation` WHERE `species`='ath' JOIN annot_sources ON annotation.source_key = annot_sources.pkey GROUP BY source_key,type;
Sql is complaining about the syntax, so you can assume that all the table and column names are correct.
Michiel
PS: The winner can go get a free hotdog downstairs :p
-- ================================================================== Michiel Van Bel PhD student Tel:+32 (0)9 331 36 95 fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, Ghent University Technologiepark 927, 9052 Gent, BELGIUM mibel@psb.ugent.be http://www.psb.ugent.be ==================================================================

so what is the solution... Michiel Van Bel wrote:
ok problem solved,
apparently i've been sleeping through the DB-practice sessions :D
Michiel Van Bel wrote:
Hey,
can somebody point out what is wrong with this query? I do not really see anything wrong with the syntax, but apparently, there is :(
SELECT `common_name`, `type`, count(`gene_id`) AS `count` FROM `annotation` WHERE `species`='ath' JOIN annot_sources ON annotation.source_key = annot_sources.pkey GROUP BY source_key,type;
Sql is complaining about the syntax, so you can assume that all the table and column names are correct.
Michiel
PS: The winner can go get a free hotdog downstairs :p
-- ================================================================== Ward Blondé wablo@psb.ugent.be PhD student Tel:+32 (0)9 331 38 24 fax:+32 (0)9 3313809 VIB Department of Plant Systems Biology, Ghent University Technologiepark 927, 9052 Gent, BELGIUM http://www.psb.ugent.be/cbd/people_ward_blonde.php ==================================================================

Don't put the WHERE clause in front of the JOIN :) -Kenny On Thu, 29 May 2008, Ward Blondé wrote:
so what is the solution...
Michiel Van Bel wrote:
ok problem solved,
apparently i've been sleeping through the DB-practice sessions :D
Michiel Van Bel wrote:
Hey,
can somebody point out what is wrong with this query? I do not really see anything wrong with the syntax, but apparently, there is :(
SELECT `common_name`, `type`, count(`gene_id`) AS `count` FROM `annotation` WHERE `species`='ath' JOIN annot_sources ON annotation.source_key = annot_sources.pkey GROUP BY source_key,type;
Sql is complaining about the syntax, so you can assume that all the table and column names are correct.
Michiel
PS: The winner can go get a free hotdog downstairs :p
--
participants (3)
-
Kenny Billiau
-
Michiel Van Bel
-
Ward Blondé