SQL help

Steve Albin steve at steve-albin.com
Fri Feb 25 14:50:17 CST 2011


I built this SQL using VStudio 4.8 SQL builder:

SELECT TypeGenre.cTypeAbbrev, AlbumTags.nAlbumId, Albums.cTitle, Albums.nAlbumId
FROM	AlbumTags RIGHT OUTER JOIN TypeGenre ON AlbumTags.typePtr = TypeGenre.RecID 
	AlbumTags INNER JOIN Albums ON AlbumTags.albumPtr = Albums.RecID 
WHERE Albums.nAlbumId = 1

On running this, I get an error saying unexpected WHERE token.

I created this SQL myself:

SELECT TypeGenre.cTypeAbbrev, AlbumTags.nAlbumId, Albums.cTitle, Albums.nAlbumId
FROM	AlbumTags,TypeGenre, Albums
WHERE (albums.nAlbumId= 1)
and AlbumTags.typePtr =* TypeGenre.RecID 
and AlbumTags.albumPtr = Albums.RecID

This gives me the result I am looking for.

My question is, what is wrong with the first SQL?  Do we have a bug in VStudio?  Am I missing something obvious?

--
Steve Albin, Montclair, NJ
http://www.steve-albin.com
http://www.jazzdiscography.com



More information about the Valentina mailing list