jonniejoejonson Posted March 19, 2011 Share Posted March 19, 2011 I have a mediaTable, to store info about images, video, text, audio. mediaId mediaType mediaFilename mediaTitle I want to SELECT * FROM mediaTable WHERE mediaId=’12’; However… if the mediaType selected was ‘video’, i would like to join to the video table to get some extra data.. how would you do this? ….or would you just run to 2 sql statements? Alternatively would you recommend simply having an image table, a video table, audio table, rather than a media table Kind regards J Quote Link to comment Share on other sites More sharing options...
sunfighter Posted March 21, 2011 Share Posted March 21, 2011 I would use two sql statements. BUT why not just add the additional video data to this DB? You can leave the columns blank for all other media, and filled in for the video info. Then you get all your data in one query. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.