I am trying to get the top blog poster from mysql db
in it works:
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.
No comments:
Post a Comment