Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8209599
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T09:46:47+00:00 2026-06-07T09:46:47+00:00

I think I have a conflict between my knowledge on SQL Server and MySQL.

  • 0

I think I have a conflict between my knowledge on SQL Server and MySQL.
When I run this query, I get an error always from MySQL:

If EXISTS (select * from tbl_admin) THEN
    select 'OK';
END IF;

The error message is:

[Err] 1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘if EXISTS (select * from tbl_admin) then select ‘1’
— select ‘1’ WHERE EXISTS ‘ at line 1

Please help me and tell me am I wrong in writing this query? What’s wrong?
I want to do something if I have something in tbl_admin table.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T09:46:50+00:00Added an answer on June 7, 2026 at 9:46 am
    select 'ok'
    from INFORMATION_SCHEMA.tables
    where table_name = 'tbl_admin'
    

    edit

    To check if a table contains data you can do this:

    SELECT 'OK' FROM dual
    WHERE EXISTS (SELECT * FROM tbl_admin);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: jQuery & Prototype Conflict I think I have a problem between jQuery
I think I have this working but I need advice. I'd like to know
I am getting below said collation error since I have moved from a desktop
This time I think it's not me being stupid but an actual conflict. I
Solution : https://github.com/alexgibson/tap.js I have a conflict between 'touchend' and 'touchmove' events on the
I have a table in SQL Server 2008 R2 that holds positions for different
I think I have a synchronization problem...It may be too basic..Please help.. I have
I think I have a problem in understanding the proper way of using MVC.
I think I have a basic understanding of REST, but something I'm stuck on
I think I have a conceptual misunderstanding and would appreciate an explanation. Within a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.