tag:blogger.com,1999:blog-12233913.post111373390202953350..comments2023-04-16T04:17:43.152-07:00Comments on MySQL Tips: MySQL outer join SQL tutorial/examplesTravelTouristVideoshttp://www.blogger.com/profile/06397377314569093942noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-12233913.post-57463830614603215022009-11-03T07:06:31.380-08:002009-11-03T07:06:31.380-08:00i really have a problem with mysql and the join fu...i really have a problem with mysql and the join function. <br />i have 3 tables, lets say bad_jokes, good_jokes and regular_jokes. but all of them have the same fields. i mean the fields or columns in each of them are: title (of the joke), body and date_entered. i actually have more fields, but it doesnt matter. what it matters is that all the 3 tables have the same field names. how can i make a query to select the last 3 jokes in each table, for example? or the jokes added in the last 3 days ( in all tables, of course ). it seems a little difficult to realise.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-12233913.post-73456734037075873152009-03-30T22:40:00.000-07:002009-03-30T22:40:00.000-07:00Hi can u help in following :i have two tables "us...Hi can u help in following :<BR/><BR/>i have two tables "users" and users_role". both have a field "activity_status__code".<BR/>If a user is assigned a "role" an entry is made in "user_role " table.I want to retrieve all records of userrs table even if there are no records in "users_role " for some users.one more thing is that if there is record in "user_role " for some user then it should b retrieved only if user_role.activity_status__code='30'Manju Choudharynoreply@blogger.comtag:blogger.com,1999:blog-12233913.post-56919040646326517872009-03-02T22:56:00.000-08:002009-03-02T22:56:00.000-08:00Thankful for valuable informationThankful for valuable informationAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-12233913.post-1154052538916592582006-07-27T19:08:00.000-07:002006-07-27T19:08:00.000-07:00Additional info on my first query...It is possible...Additional info on my first query...<BR/><BR/>It is possible that a certain product was not sold nor bought.<BR/><BR/>If this is the scenario, the product must still be a part of the summary.<BR/><BR/>Any help for this?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-12233913.post-1154052376827022612006-07-27T19:06:00.000-07:002006-07-27T19:06:00.000-07:00How about this scenarioI have 3 tables namely Prod...How about this scenario<BR/><BR/>I have 3 tables namely Product, SalesDetails and PurchaseDetails<BR/><BR/>SalesDetails contains the QuantitySold for each product (it has multiple instances, say Code 'P1' was sold 4 times, so it has 4 instances in the Salesdetails table)<BR/><BR/>Same is true with PurchaseDetails<BR/><BR/>I want to create a summary of Products showing the Total Quantity Sold and Total Quantity Purchased.<BR/><BR/>What is the SQL statement do do it?Anonymousnoreply@blogger.com