Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
267 views
in Technique[技术] by (71.8m points)

mysql - SQL query with joins that shows only rows until 23.11.2020

I created this query and it only takes rows until date 23.11.2020 doesn't take more then 2-3 hundred rows.

SELECT a.datum
     , a.cas
     , a.domaci
     , a.hoste
     , a.stream
     , b.name
     , b.color2
     , c.jmeno
     , d.firstname as first1
     , d.lastname as last1
     , e.firstname as first2
     , e.lastname as last2 
  FROM zapasy a 
  JOIN projekt b 
    ON b.id = a.projekt 
  JOIN televize c 
    ON c.id = a.televize 
  JOIN tipuser d 
    ON d.id = a.komentator1 
  JOIN tipuser e 
    ON e.id = a.komentator2 
  JOIN projekt_role f 
    ON f.userid = $uid
 ORDER 
    BY datum DESC
     , cas ASC
     , domaci asc
     , projekt asc
     , stream ASC 

Is there some kind of limit in SQL that just won't show me some rows if I use too many JOINS ?

question from:https://stackoverflow.com/questions/65844922/sql-query-with-joins-that-shows-only-rows-until-23-11-2020

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Without knowing your data we can't diagnose this. But these aren't too many joins at all.

Suggestion: Remove your joins, one at a time, and look at the results. If, at any stage, you will get the rows that you are now missing, then you can try to find out why that particular join filtered them out.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...