MySQL requires that all derived tables and subqueries have an alias. You are missing an alias at the end of the closing parentheses for the subqquery:
SELECT * FROM students as st INNER JOIN ( SELECT att.roll_no,att.full_name, SUM(att.hasAttended= 'P') AS DaysPresent, SUM(att.hasAttended= 'A') AS DaysAbsent, COUNT(*) AS totalClasses FROM attendance as att GROUP BY att.roll_no ) att ---------------------------< this is missing ON st.roll_no = att.roll_no WHERE st.class = 1 ORDER BY st.roll_no
Related Posts:
- How to join two tables by multiple columns in SQL?
- Warning: session_start(): Cannot send session cookie – headers already sent by (output started at [duplicate]
- How to set initial value and auto increment in MySQL?
- did you specify the right host or port? error on Kubernetes
- How does Java’s PriorityQueue differ from a min-heap?
- Fatal error: Call to undefined function mysql_connect()
- What is a Memory Heap?
- 403 Forbidden vs 401 Unauthorized HTTP responses
- Advanced AREL or just Rails Query for has_many through search by association
- Case statement in MySQL
- How to convert .crt to .pem [duplicate]
- pagebreak in markdown while creating pdf
- MySQL DROP all tables, ignoring foreign keys
- fix java.net.SocketTimeoutException: Read timed out
- Setting up foreign keys in phpMyAdmin?
- Sqoop Incremental Import
- What does it mean by word size in computer?
- Convert a CERT/PEM certificate to a PFX certificate
- ERROR 2002 (HY000): Can’t connect to local MySQL server through socket ‘/var/run/mysqld/mysqld.sock’ (2)
- What is process.env.PORT in Node.js?
- Lost connection to MySQL server at ‘reading initial communication packet’, system error: 0
- git: fatal unable to auto-detect email address
- Access denied; you need (at least one of) the SUPER privilege(s) for this operation
- simple IPython example raises exception on sys.exit()
- How to get a minecarft session ID?
- Factory Pattern. When to use factory methods?
- How to send a PUT/DELETE request in jQuery?
- The used SELECT statements have a different number of columns
- apt-get for Cygwin?
- #1214 – The used table type doesn’t support FULLTEXT indexes
- Python: What OS am I running on?
- ER-Diagram: Ternary Relationship – How to read properly?
- How can I diff 2 files while ignoring leading white space
- importing a CSV into phpmyadmin
- Converting time stamps in excel to dates
- How to use the keyword ‘references’ in MySQL?
- Why define PI = 4*ATAN(1.d0)
- Java: Not a statement
- select * from table where column = something or, when unavailable, column = something else
- Differences between utf8 and latin1
- Passing a hexadecimal value into a module in Verilog
- What are the recommended database permissions for WordPress?
- Resetting comment count
- simple sql query on wp_postmeta very slow
- How to apply a patch?
- Changing user_nicename
- Fulltext search in posts sorted by relevancy
- SQL query to delete comments older than 90 days?
- Regex to turn embedded images in to attachments
- Sortable admin column for one meta key with three possible meta values
- Can’t publish new posts
- AJAX in WordPress, sending coords data to MySQL and show after into map
- Manually query posts by taxonomy with MySQL
- How to bulk delete all WordPress subscribers?
- How can I trash multiple posts at once from the front end?
- Is there a way to get 3+ dimensional array from a single MySql command
- Changing Table Prefix for an Existing WordPresss Site
- Set meta_key and meta_value for all registered user in wordpress using sql query [closed]
- How do I get the posts within a certain year/date(with sql query)?
- Can I restart MySQL engine when WordPress website is live?
- Alter query with posts_clauses to retrieve NULL values last
- wpdb custom tables without plugin
- new multisite, old db
- Call to undefined function get_user_meta() – trying to access data in MySQL from custom fields
- Update or insert meta key value – On Duplicate key update
- Connect to MySQL using Windows Authentication
- pagination on data fetched using SQL query
- how update data through ajax and jquery
- How to get INSERT errors from $wpdb?
- Delete all user’s meta without knowing all the ‘key’
- How do I prepare strings for insertions as values into a MySQL table?
- How can I detect right db type?
- How to select particular month post from table and update the post status using MySQL?
- WordPress database error You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version [closed]
- How to get a value from wp_dropdown_user?
- WordPress & MySQL , problem with use many array in meta_query
- Using Ajax to submit a form, and run a SQL Select query based on user input from the form
- How to Get Last ID?
- Get All Results From Other Users That Share The Same Custom User Meta As Current User
- call to undefined function mysql_connect
- Recovery – Restore Database after moving folder location locally
- WordPress cloning issue
- How to edit content in WordPress and the Polylang – plugin? – with demosite
- Case insensitive ORDERBY in wpquery
- Search returns “Nothing Found” on a sub directory
- Update a user meta key based on WooCommerce product purchase
- How do I insert content of various MySQL fields in post?
- MySQL database migration to WordPress
- cannot log in to the mysql server (wamp and wordpress)
- How do I deal with a compromised server?
- Something is burning in the server room; how can I quickly identify what it is?
- Finding out what user Apache is running as?
- Do systemd unit files have to be reloaded when modified?
- What is a glue record?
- How do I convert a .cer certificate to .pem?
- Run Oracle SQL script and exit from sqlplus.exe via command prompt
- Show full process name in top
- How do you do load testing and capacity planning for web sites?
- Putting form result in my database
- How can I update a value of a field depending on outside source?