Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Dec 2003
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Delete sql table of certain size

    All I need is some kind of if statement to see if an sql table has x amount of entries. It seems trivial but I can't find the answer anywhere. Help is much obliged.
    UNDER CONSTRUCTION

  • #2
    Regular Coder
    Join Date
    Jul 2010
    Location
    Oregon City
    Posts
    280
    Thanks
    5
    Thanked 50 Times in 49 Posts
    Quote Originally Posted by warhammerdude20 View Post
    All I need is some kind of if statement to see if an sql table has x amount of entries. It seems trivial but I can't find the answer anywhere. Help is much obliged.

    select count(*) from table ?

  • #3
    Regular Coder
    Join Date
    Dec 2003
    Posts
    132
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You put me on the right track and I got it working. thanks.
    UNDER CONSTRUCTION

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,987
    Thanks
    4
    Thanked 2,660 Times in 2,629 Posts
    count() is a standard SQL call, and the question refers to sql itself. I'm not sure if you are using mySQL or not (seems to be the most common on web environments), but I'll move this to the subforum Other Databases instead (since it would apply to all anyway).


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •