[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"detail-sidebar-cat-1-en-105":3,"doc-seo-573371-105":53,"doc-detail-573371-en":126},{"code":4,"msg":5,"data":6},0,"success",[7,14,19,24,29,34,39,44,49],{"id":8,"doc_module":9,"doc_module_name":10,"category_name":11,"show_sort_weight":12,"slug":13},11,1,"Template","Presentations",90,"presentations",{"id":15,"doc_module":9,"doc_module_name":10,"category_name":16,"show_sort_weight":17,"slug":18},12,"Resumes",80,"resumes",{"id":20,"doc_module":9,"doc_module_name":10,"category_name":21,"show_sort_weight":22,"slug":23},14,"Invoices",70,"invoices",{"id":25,"doc_module":9,"doc_module_name":10,"category_name":26,"show_sort_weight":27,"slug":28},15,"Posters",60,"posters",{"id":30,"doc_module":9,"doc_module_name":10,"category_name":31,"show_sort_weight":32,"slug":33},16,"Social Media",50,"social-media",{"id":35,"doc_module":9,"doc_module_name":10,"category_name":36,"show_sort_weight":37,"slug":38},17,"Forms",40,"forms",{"id":40,"doc_module":9,"doc_module_name":10,"category_name":41,"show_sort_weight":42,"slug":43},18,"Letters",30,"letters",{"id":45,"doc_module":9,"doc_module_name":10,"category_name":46,"show_sort_weight":47,"slug":48},21,"Paper Templates",5,"papers-templates",{"id":50,"doc_module":9,"doc_module_name":10,"category_name":51,"show_sort_weight":4,"slug":52},158,"General","general-158",{"code":4,"msg":54,"data":55},"ok",{"site_id":56,"language":57,"slug":58,"title":59,"keywords":60,"description":61,"schema_data":62,"social_meta":119,"head_meta":121,"extra_data":123,"updated_unix":125},105,"en","sql-reference-resources-select-statements-joins-online-references-books","SQL Reference & Resources - Select Statements - Joins - Online References - Books","","A concise SQL reference compiling core SELECT statement patterns, including column selection, filtering with logical conditions (AND, OR, NOT, IN, LIKE, BETWEEN), grouping with aggregation (SUM, MIN, MAX, MEAN/AVG, COUNT, VAR, STDEV), and post-aggregation filtering via HAVING. It also summarizes join types—INNER, LEFT, and RIGHT—showing how matching criteria affect which rows appear. The guide further lists online SQL learning and documentation resources and recommended SQL-related books, plus sample SAS PROC SQL queries using multiple joins and reports.",{"@graph":63,"@context":118},[64,80,101],{"@type":65,"itemListElement":66},"BreadcrumbList",[67,71,74,77],{"item":68,"name":69,"@type":70,"position":9},"https://docshare.wps.com","Home","ListItem",{"item":72,"name":10,"@type":70,"position":73},"https://docshare.wps.com/template/",2,{"item":75,"name":11,"@type":70,"position":76},"https://docshare.wps.com/template/presentations/",3,{"item":78,"name":59,"@type":70,"position":79},"https://docshare.wps.com/template/sql-reference-resources-select-statements-joins-online-references-books/573371/",4,{"url":78,"name":59,"@type":81,"image":82,"author":87,"headline":59,"publisher":90,"fileFormat":93,"inLanguage":57,"description":61,"dateModified":94,"datePublished":95,"encodingFormat":93,"isAccessibleForFree":96,"interactionStatistic":97},"DigitalDocument",{"url":83,"@type":84,"width":85,"height":86},"https://docshare.wps.com/thumbnails/sql-reference-resources-select-statements-joins-online-references-books/573371.png","ImageObject",442,249,{"name":88,"@type":89},"Theodore","Person",{"url":68,"name":91,"@type":92},"DocShare","Organization","application/pdf","2026-10-18","2026-10-14",true,{"@type":98,"interactionType":99,"userInteractionCount":73},"InteractionCounter",{"@type":100},"ViewAction",{"@type":102,"mainEntity":103},"FAQPage",[104,110,114],{"name":105,"@type":106,"acceptedAnswer":107},"What operators are supported in the SELECT WHERE logical conditions section?","Question",{"text":108,"@type":109},"The reference lists AND, OR, NOT, IN, LIKE, and BETWEEN as operators used within WHERE logical conditions.","Answer",{"name":111,"@type":106,"acceptedAnswer":112},"How does GROUP BY and HAVING work in the provided examples?",{"text":113,"@type":109},"It groups results by a column (GROUP BY) and then uses HAVING to keep only groups where an aggregate condition is met (e.g., SUM(col2) > 100).",{"name":115,"@type":106,"acceptedAnswer":116},"What is the difference between INNER JOIN, LEFT JOIN, and RIGHT JOIN in these examples?",{"text":117,"@type":109},"INNER JOIN returns only matching rows. LEFT JOIN returns all rows from the left table plus matching rows from the right, with NULLs where there is no match. RIGHT JOIN returns all rows from the right table plus matching rows from the left, with NULLs where there is no match.","https://schema.org",{"og:url":78,"og:type":120,"og:title":59,"og:site_name":91,"og:description":61},"article",{"robots":122,"canonical":78},"index,follow",{"doc_id":124,"site_id":56},573371,1792359686,{"code":4,"msg":5,"data":127},{"doc_id":124,"user_id":128,"nickname":88,"user_avatar":129,"doc_module":9,"category_id":8,"category_name":11,"doc_title":59,"doc_description":61,"doc_content":130,"file_id":131,"file_url":132,"file_type":133,"file_size":134,"view_count":73,"is_deleted":4,"is_public":9,"is_downloadable":9,"audit_status":9,"page_count":79,"language":135,"language_code":57,"site_id":56,"html_lang":57,"table_of_contents":136,"faqs":137,"seo_title":138,"seo_description":61,"update_tm":139,"read_time":73},7971461740886,"https://ap-avatar.wpscdn.com/davatar_3d24733baf745e90a7e4bdd5f77d97b2","SQL Reference & Resources  \nSelect Statements  \nSELECT *  \nFROM table1  \n-Select all rows and columns (*) from table1  \nSELECT col1, col2  \nFROM table1  \n-Select columns col1 and col2 and all rows from table1  \nSELECT col1, col2  \nFROM table1  \nWHERE logical-conditions  \n-Select columns col1 and col2 and all rows from table1 where the rows meet the logical conditions. Operators: AND, OR, NOT, IN, LIKE, BETWEEN.  \nSELECT col1, sum(col2) as col2sum  \nFROM table1  \nGROUP BY col1  \n-Select the values of column col1 and the sum of col2 over the distinct values of col1 . Could also use other aggregation functions: SUM, MIN, MAX, MEAN/AVG, COUNT, VAR, STDEV.  \nSELECT col1, sum(col2) as col2sum  \nFROM table1  \nGROUP BY col1  \nHAVING sum(col2) > 100  \n-Select the values of column col1 and the sum of col2 over the distinct values of col1, keeping only values of col1 that have a sum over 100. Could also use other aggregation functions: SUM, MIN, MAX, MEAN/AVG, COUNT, VAR, STDEV.  \nJoins  \nSELECT * FROM table1 INNER JOIN table2 ON join-conditions  \n-Join all rows oftable1 with rows oftable2 that match the join-condition (typically identical keys) .  \nSELECT * FROM table1 LEFT JOIN table2 ON join-conditions  \n-Join all rows oftable1 with rows oftable2 that match the join-condition (typically identical keys) . Result contains all rows oftable1; rows that do not match the join-condition have missing/null values for the columns from table2  \nSELECT * FROM table1 RIGHT JOIN table2 ON join-conditions  \n-Join all rows oftable1 with rows oftable2 that match the join-condition (typically identical keys) . Result contains all rows oftable2; rows that do not match the join-condition have missing/null values for the columns from table1  \nOnline References  \n• SAS Online Documentation  \n• [http://support.sas.com/onlinedoc/913/docMainpage.jsp](http://support.sas.com/onlinedoc/913/docMainpage.jsp)  \n• Base SAS Æ Base SAS Procedures Guide Æ SAS SQL Procedure User’s Guide  \n• MS Access SQL Documentation  \n• [http://office.microsoft.com/en-us/access-help/CH010072899.aspx](http://office.microsoft.com/en-us/access-help/CH010072899.aspx)  \n• SQL Tutorial  \n• [http://www.sqltutorial.org](http://www.sqltutorial.org)  \n• SQL Cheat Sheet-[http://www.sqltutorial.org/sql-cheat-sheet.aspx](http://www.sqltutorial.org/sql-cheat-sheet.aspx)  \nBooks  \n• O’Reilly Books ([http://shop.oreilly.com](http://shop.oreilly.com))  \n•  Learning SQL, 2nd Edition  \n•  SQL In a Nutshell, 3rd Edition  \n•  SQL Cookbook, 1st Edition  \n•  SQL Pocket Guide, 3rd Edition  \n• SAS Publishing ([http://support.sas.com/publishing/](http://support.sas.com/publishing/))  \n•  PROC SQL: Beyond the Basics Using SAS  \n•  PROC SQL By Example: Using SQL Within SAS  \n/* Sample code for TAIR 2012 Presentation */  \nlibname tair \"C:\\Documents and Settings\\prhodes\\Desktop\\TAIR 2012\\data\"; run;  \nproc sql; /* Example 1: Basic Query */  \nselect *  \nfrom tair.students; quit;  \nproc sql; /* Example 2: Subsetting */  \nselect *  \nfrom tair.students  \nwhere home_state ne 'TX'; quit;  \nproc sql; /* Example 3: Inner Join */ select [a.id](a.id) , a.home_state, b.class from tair.students as a,  \ntair.acad_info as b where [a.id = b.id](a.id = b.id) and  \nhome_state ne 'TX'; quit;  \nproc sql; /* Example 4: Left Join */ select [a.id](a.id) , a.gender, b.course from tair.students as a  \nleft join tair.schedule as bon [a.id=b.id](a.id=b.id)  \nwhere a.home_state\u003C>'TX'; quit;  \nproc sql; /* Example 5: Basic Report */ select home_state as state label='State',  \ncount(distinct id) as number label='Number'from tair.students  \ngroup by home_state; quit;  \nproc sql; /* Example 6: Basic Report 2 */ select [a.id](a.id) , b.class,  \nsum( [c.credit_hrs](c.credit_hrs) ) as total_hours from tair.students as a,  \ntair.acad_info as b,  \ntair.schedule as c where [a.id=b.id](a.id=b.id) and  \n[b.id=c.id](b.id=c.id)[ ](b.id=c.id)group by [a.id](a.id) , b.class  \nhaving sum( [c.credit_hrs](c.credit_hrs) )>18  \norder by class;  \nquit;","cbCainrnPraXZGs4","https://ap.wps.com/l/cbCainrnPraXZGs4","pdf",2060128,"English","# Select Statements\n## Joins\n## Online References\n## Books","[{\"question\":\"What operators are supported in the SELECT WHERE logical conditions section?\",\"answer\":\"The reference lists AND, OR, NOT, IN, LIKE, and BETWEEN as operators used within WHERE logical conditions.\"},{\"question\":\"How does GROUP BY and HAVING work in the provided examples?\",\"answer\":\"It groups results by a column (GROUP BY) and then uses HAVING to keep only groups where an aggregate condition is met (e.g., SUM(col2) \\u003e 100).\"},{\"question\":\"What is the difference between INNER JOIN, LEFT JOIN, and RIGHT JOIN in these examples?\",\"answer\":\"INNER JOIN returns only matching rows. LEFT JOIN returns all rows from the left table plus matching rows from the right, with NULLs where there is no match. RIGHT JOIN returns all rows from the right table plus matching rows from the left, with NULLs where there is no match.\"}]","SQL Reference & Resources - Select Statements - Joins - Online References - Books | PDF",1791938470]