I am trying to get the top blog poster from mysql db
in it works:
`username`, COUNT (` owner_id`) as frequencies, `` owner_id` from engine4_blog_blogs`, `engine4_users` Jhan` By gener4_users`.`user_id` = `owner_id`, the owner_id` command group repeats the DESC limit 1 which creates: Username / Frequencies / owner_id jack91 / 10/4 Which is correct. Now I also need to get the thumbnail icon for whatever I need, so I try: SELECT `username`, COUNT ( `engine4_blog_blogs`.`owner_id`) frequencies,` owner_id`, `` engine4_blog_blogs`, `engine4_users`, Swami_aidi` as` engine4_storage_files` from storage_path` Jhan` engine4_users`.`user_id` = `engine4_blog_blogs`.` and` engine 4_yujrs`k` Ughr_aidi` = `engine 4_storej_fail`k` Ughr_aidi` group by frequencies by` engine 4_blog_ blogs' DESC .`owner_id` the LIMIT order 1 Creates: Username / Frequencies / owner_id / storage_path jack91 / 2480/4 / (public / user / 1f / 001f_250b.JPG) < P> username, owner_id & amp; Storage_path is correct but what is DB calculation because this value is not true for magnitude? I COUNT4 ( engine4_blog_blogs . Swami_aidi ) was thought by specifying that it is Ginata only on the field - I would also add that column field Owner_id exists only in the engine4_blog_blogs table. I have now tried different sequences including JOINS, INNER JOINS and LEFT JOINS and all produce the same results ... wrong count (). Basically I'm looking for this output: Username / Frequencies / owner_id / storage_path jack91 / 10/4 / (public / user / 1f / 001f_250b.jpg) Do anyone know what I'm doing wrong (please note that I have not touched SQL in 10 years)? Thanks for any help! You create all the unsecured columns must be set: SELECT 'username', COUNT (DISTINCT `engine4_blog_blogs`.blog_id`) AS presentations,` Swami_aidi`, `Bndarn_path` Se` Injan4_ Blog_blogs`,` engine4_users` , `engine4_storage_files` where` engine4_users`.`user_id` = `engine4_blog_blogs`.`owner_id` and 1,3,4 order` engine4_users`.`user_id` = `engine4_storage_files`.`user_id` group by frequencies DESC LIMIT 1 you get the number of separately Writer blog for DISTINCT to add the keyword to COUNT () . * Mysql supports non-standard group syntax - if you stick with standard, then it will work as you expect. Posted by Unknown at 03:22 Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest No comments: Post a Comment Newer Post Older Post Home Subscribe to: Post Comments (Atom) About Me Unknown View my complete profile Blog Archive ► 2015 (1583) ► September (174) ► August (172) ► July (180) ► June (160) ► May (201) ► April (172) ► March (173) ► February (183) ► January (168) ▼ 2014 (1684) ► September (186) ► August (180) ► July (160) ► June (167) ► May (187) ▼ April (176) objective c - Adding An AlertView At viewWillAppea... python - Set and use flags against a users profile... c# - Quick and dirty reflection based XML Serializ... c# - Pulling Images from RSS Feed - .net - How to serialize a derived class as its bas... linux - Bash: How do I truncate an array? - objective c - iPhone language setting - datetime - Natural/Relative days in Python - .net - Centre the background of a TabControl in WPF - language design - Pros and cons of Go rejecting un... c# - WCF, containers in DataContract - Picking the right SQL Server collation for storage - com - Is PIA embedding broken in .NET 4.0 beta 2? - mod rewrite - Question about url rewriting using a... Xcode 3.2 Debug: Seeing whats in a string? - A bug in Flex SDK 3.4?? FocusManager.focusInHandle... iphone - Block touch propagation to other view - Foreign key disappears when I do reverse engineeri... flex3 - How to create a "spacer" in a Flex LinkBar? - open source - Commercial OS based on Linux, legal ... codeigniter - mySQL join question - jquery - Javascript run-time analysis - mysql - How to get data from a joined table - python - PyQt subclassing - CSS - Float Left and Anchor Element - sharepoint - how to temporarily disable email noti... openxml - In PowerPoint 2007, how can I position a... php - change button action to url adress or bash s... inheritance - ASP.NET MVC ModelBinding Inherited C... linux - file lock leases via NFS v4 in C - php - Getting dynamic HTML output from another pag... javascript - Quickest way to pass data to a popup ... version control - Git: removing a file from being ... Is it possible to compare private attributes in Ru... html - CSS Rendering List Items in 2 rows - php - How to get the value of id(primary key) in p... iphone - Image Picker Issue - php - selecting rows that are older than current d... graphics - Blackberry app, how to add an image on ... internet explorer - http proxy for debugging purpo... javascript - iPhone Web App disable cache - php - Zend_Auth_Adapter_DbTable to authenticate us... iphone - I want to scroll to a row in a table view... Hibernate Search question - vb.net - How do you declare a C# variable into an ... can i change the default encoding of my mysql serv... Adding external images to PDF using iText - How can Mercurial be copyright and free software? - .net - Is there a workaround for the unsupported I... android - How can I create a menu? - vlc - What are possible values for --rawvid-chroma - assembly - fasm, searching a word in dos environme... javascript - dat.GUI create multiple buttons with ... Playing sounds in Python without external module? - How to upload local PowerPoint file to SharePoint ... sql - INSERT INTO with SELECT using OUTPUT - MS Excel to Database - sql - Error from MS Access ODBC--call failed - batch file - Open URL with a set Target - php - How to update .htaccess in virtual host - sql - XML DML Replace with a Function Result - html - Hot to get svg inside a span using jQuery's... sql - Getting parsing error with the following cas... python - Data sorting within lists within dictiona... excel - Spreadsheet stored on Sharepoint needed in... Time complexity of this unique string algorithm - C# pass element of value type array by reference - mysql - Complex querying on table with multiple us... ruby on rails - Stop Braintree paypal in modal ope... objective c - proper use of viewcontrollers and MV... java - Modify Applets to Support 2nd Environment - iterate json into bash variable - java - Hadoop Map Reduce Query - c - End condition for precision integration loop - .htaccess - php files are not accessible, getting ... php - htaccess how to rewrite any url ending with ... python - Setting up an empty time series dataframe... libgdx - Can't load file in android studio - agent - UVM: connecting sequencer+monitor with a s... php - DOMDocument disable character escaping - node.js - Location of npm CA cert - java - Spring boot multi module testing - nhibernate - Orchard CMS counting Content Items qu... angularjs - How to detect removed item in $scope.$... javascript - How can I retrieve and display slider... c++ - No matching member function in Map insert - android - How to use voice recognition and auto wr... c# 4.0 - get old item name for renamed files using... process - Running a program from Java(triggered by... Java - How to restrict method calling from a speci... javascript - How to know when an iframe comes into... opengl - Using shader to move texel to its center - delphi - Refresh a tcxgrid without losing the curr... javascript - Jquery add more with html object - java - Sort Array by Alpabetical order using Selec... python - Creating several grids at a time - Dividing a Int and turning it to string - excel - Get all dates between 2 dates in vba - Array indexing inconsistent between script and con... Outlook VBA: Script not triggering on email receiv... ► March (200) ► February (241) ► January (187) ► 2013 (1486) ► September (169) ► August (163) ► July (161) ► June (162) ► May (156) ► April (170) ► March (174) ► February (164) ► January (167) ► 2012 (1541) ► September (176) ► August (160) ► July (163) ► June (179) ► May (169) ► April (158) ► March (201) ► February (168) ► January (167) ► 2011 (1528) ► September (167) ► August (176) ► July (169) ► June (184) ► May (157) ► April (182) ► March (166) ► February (171) ► January (156) ► 2010 (1540) ► September (147) ► August (182) ► July (168) ► June (162) ► May (188) ► April (169) ► March (194) ► February (164) ► January (166) Simple theme. Powered by Blogger.