• Wednesday , 27 March 2019

MySQL Database Tutorial – 7 – DISTINCT and LIMIT

Code Canyon



Facebook – https://www.facebook.com/TheNewBoston-464114846956315/ GitHub – https://github.com/buckyroberts Google+ …

Original source

3d Ocean

Related Posts

43 Comments

  1. Johnny Rouddro
    February 20, 2019 at 04:07

    In case anyone's wondering how to get the last 10 results. just LIMIT 0, 10 and sort it in descending order with DESC. tutorial 8 and 9 will get you there.

  2. Women Empowerment
    February 20, 2019 at 04:07

    How to compare two column value in same table

  3. Ptmp727
    February 20, 2019 at 04:07

    Its not working for me

  4. Special Talent
    February 20, 2019 at 04:07

    Place of 'distinct' why we will not take 'group by' sir

  5. TOP 10 HINDI
    February 20, 2019 at 04:07

    very well explained

  6. Tayyab Mazhar
    February 20, 2019 at 04:07

    LIMIT 5 is same as LIMIT 0,5. Which means to start from 'INDEX 0' which is 'ID 1', and retrieve five rows (id 1,2,3,4,5).
    Similarly, 'LIMIT 5,10' means to start from 'INDEX 5' which is 'ID 6', and retrieve 10 rows meaning –> ID 6,7,8,9,10,11,12,13,14,15.
    SIMPLE!

  7. Yavor Kirov
    February 20, 2019 at 04:07

    I love how Harry Potter is your customer 3:30 🙂

  8. gopal
    February 20, 2019 at 04:07

    Limit 5 is used because we used 1,2,3,4… As id which was our primary key? What if our id is our primary key but instead of 1,2,3… i used 87FUP as the id? How am i now going to put the limit?

  9. Ke W
    February 20, 2019 at 04:07

    "Okay just gimme an hour" , types in command in 4 seconds haha

  10. Vaughn Johnson
    February 20, 2019 at 04:07

    THIS IS AN INCREDIBLY VALUABLE THING.

  11. Esraa Mohamed
    February 20, 2019 at 04:07

    Thank you!

  12. Goran Marinkovic
    February 20, 2019 at 04:07

    Thnx bro

  13. Ms. Akira E. Dionio
    February 20, 2019 at 04:07

    hi! what if i wanted to put the first 5 on section A, and started from 1-10 on section B , i dont know where I can adjust this 🙁

  14. Gaurang Datt
    February 20, 2019 at 04:07

    I'm using oracle database 11g and the limit keyword is is not being executed in it…it's showing me an error

  15. Suraj Bobade
    February 20, 2019 at 04:07

    so how can i get the last value then…?

  16. TheSpaceninjas
    February 20, 2019 at 04:07

    Like your vids, very good way to teach something that's actually pretty simple when you wrap your head around it compared to other aspects of coding. I'd like to point out that limit does not work inherently with Microsoft SQL Server. You need to write the query something like this:

    SELECT TOP 10 property_id, device_id, name FROM device_property ORDER BY property_id DESC

    or like this

    SELECT property_id, device_id, name FROM device_property ORDER BY property_id OFFSET 10 ROWS FETCH NEXT 10 ROWS ONLY

  17. Jayesh Motwani
    February 20, 2019 at 04:07

    hey buddy let me tell you, your teaching way is awesome. The way you crack the jokes in between are damn too awesome. Still laughing… 😛

  18. Panagiwths Makropoulos
    February 20, 2019 at 04:07

    i think u should mention the fact that when we write LIMIT 5 (only 1 number) it will show the first 5 ids-names although it starts counting from 0. If it was starting counting from 0, wouldn't it show 6 ids-names(?). 0->1(1ist id) 1->2(2nd id) …… 5(LIMIT)->6(6th id) but that's not what happening

  19. Pc GamingHD
    February 20, 2019 at 04:07

    lol treehouse is gonna help that ad come every single time

  20. In Bota
    February 20, 2019 at 04:07

    You made a mistake explaining the query with two numbers.
    First number isn't the starting point but the number of rows that will be trimmed from the results (starting from 1, not zero because NULL is ignored, because it seem like you don't have it).
    It does start counting from zero, but in that case, the first displayed number would be 5, not 6.
    Counting with zero: 0, 1, 2, 3, 4 – these would be trimmed and the list would start from 5.

  21. FAHAD MOHAMMAD
    February 20, 2019 at 04:07

    Hey can some1 help me out with this:
    What if I wanted to know how many customers are from each state ???
    will this do ???
    SELECT COUNT(state)
    FROM customers
    GROUP BY state

  22. StormyJaspersky
    February 20, 2019 at 04:07

    #DisrespectYourBoss with Bucky Roberts😂

  23. Özer Çevikaslan
    February 20, 2019 at 04:07

    how do we combine mysql with php codes ? I mean how we do combine with index.php ?

  24. Ramir Enriquez
    February 20, 2019 at 04:07

    One hour haha and used it for extended break

  25. Declan Marks
    February 20, 2019 at 04:07

    Bad database practive. None of your data is normalised. For name you put the whole name in one column. First name and second name should have been put in separate columns

  26. Majestic Barrack
    February 20, 2019 at 04:07

    hi bucky how to comment on your tnb form i don't knew can you help me plz??

  27. Majestic Barrack
    February 20, 2019 at 04:07

    if pc starts from 0 then it must starts from 4 or 5 but it starts from 6 🙁 but than god u explain limit

  28. Proper Sag
    February 20, 2019 at 04:07

    you have the talent to make the most painfully boring stuff, intresting!
    <3

  29. Faizah al-Katheri
    February 20, 2019 at 04:07

    You are smart and funny.. that's sexy <3

  30. Summer Lee
    February 20, 2019 at 04:07

    thank you very much!

  31. ►►► FireBoy2708 ◄◄◄
    February 20, 2019 at 04:07

    I hope this comment gets more than 3 like

  32. John Smith
    February 20, 2019 at 04:07

    lmao…hallarious tutorials. the most useful too

  33. Gary Lee
    February 20, 2019 at 04:07

    These IT jokes are hilarious

  34. Troy Najera
    February 20, 2019 at 04:07

    For anyone confused about the numbering of the LIMIT keyword with multiple values, read this:

    Bucky is right when he says that the index count starts at 0. By index count, I mean that the very first row in the column has an index of 0. 

    Where people are getting confused is the fact that the IDs start at 1. Look below for explanation:

    index 0       id 1
    index 1       id 2
    index 2       id 3
    index 3       id 4
    index 4       id 5
    index 5       id 6

    index 14     id 15

    So when you type LIMIT 5, 10  the 5 is referring to the index of 5, meaning it will start by showing id 6. The 10 is referring to how many total rows will be displayed, which is why it only goes up to index of 14 because that's a total of 10 rows if you include the index of 5.

    Hope this helps!

  35. John Anderson
    February 20, 2019 at 04:07

    Correct me if I'm wrong but Limit 5,10 should start at 4 if using 0 as the first number, not 6 (0,1, 2, 3, 4 = 5) It appears that LIMIT 5,10 means 10 people after the first 5 IDs (6). If your key started at 100 then LIMIT 5, 10 would start at id 105 (bypassing 100, 101, 102, 103, 104) a small mistake in a great sea of video.

  36. Bob Bobby
    February 20, 2019 at 04:07

    430 Likes, 0 Dislikes 🙂 Deservedly so!

  37. Nourah Bin Hussain
    February 20, 2019 at 04:07

    Thanks a lot, I like your tutorial 🙂

  38. Kampinator
    February 20, 2019 at 04:07

    Okay, i laughed a bit! Thanks for tutorials. I'm sure to check you'r forums too 🙂

  39. DeadKatBounce
    February 20, 2019 at 04:07

    haha you're so awesome

  40. 0wasserfall
    February 20, 2019 at 04:07

    5 Harry Potter 😀

  41. TTV5
    February 20, 2019 at 04:07

    My boys would call me Bucky?

  42. Yuri konichiwa
    February 20, 2019 at 04:07

    or sudo apt-get install php5-c*rl
    it will look for any package with the latters "php5-crl" it will fill in the missing letters based on what you gave it say you wonna rome all files with the mp3 ext you will run rm *.mp3

  43. Yuri konichiwa
    February 20, 2019 at 04:07

    the wild card statement has he said is useful in a UNIX terminal example
    cd /home/yu*/bots
    /home/yuri/bots~#

Leave A Comment

You must be logged in to post a comment.