morrisjohnny Posted October 29, 2010 Share Posted October 29, 2010 As part of a course i'm having difficultly displaying the single result from the table `composition` i need to show `c_title` their is only one resulthere is my code.other than displaying this final field everything works. what am i missing?I've tried to add composition.c_title but it flicks back an error. it's habbit that i also use the table name before the column i know this isn't required SELECT concert.concert_venue, concert.con_dateFROM concertWHERE concert_no = ANY ( SELECT performed_in FROM Performance WHERE performed = ANY ( SELECT c_no FROM composition WHERE c_no = ANY ( SELECT cmpn_no FROM has_composed WHERE cmpr_no = ANY ( SELECT comp_no FROM composer WHERE comp_is = ANY ( SELECT m_no FROM musician WHERE m_name = 'Andy Jones' ) ) ) )) Link to comment Share on other sites More sharing options...
[dx] Posted October 29, 2010 Share Posted October 29, 2010 I guess it will be SELECT c_title FROM composition.. Link to comment Share on other sites More sharing options...
justsomeguy Posted October 29, 2010 Share Posted October 29, 2010 It sounds like you need to use joins instead of subqueries, or maybe both. What data are you trying to get? Link to comment Share on other sites More sharing options...
morrisjohnny Posted November 1, 2010 Author Share Posted November 1, 2010 Thanks Guys, but i changed it to Joins as the area i was being marked on was about sub-selects i though i would have to do it as a subselect however i admitted defeat and done it all in a joinHere's the code i used incase anyone else is wonder and for future use SELECT concert.concert_venue, concert.con_date, composition.c_titleFROM concert, performance, composition, has_composed, composer, musicianWHERE concert_no = performed_inAND performed = composition.c_noAND composition.c_no = has_composed.cmpn_noAND cmpr_no = composer.comp_noAND composer.comp_is = musician.m_noAND m_name = 'Andy Jones' Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.