PDA

View Full Version : Delete sql table of certain size


warhammerdude20
10-22-2011, 08:39 AM
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.

Adee
10-22-2011, 09:06 AM
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 ?

warhammerdude20
10-23-2011, 04:03 AM
You put me on the right track and I got it working. thanks.

Fou-Lu
10-23-2011, 05:08 PM
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).