Skip to content
Advertisement

Tag: mysql

MySQL SHOW TEMPORARY TABLES;

I’m learning SQL with MySQL 5.7. And I wanna enumerate all tables include temporary tables! But when I query SHOW TABLES; It shows only non-temporary tables. How can I list all tables?

ERROR 1046:No database selected

I would like to create a SQL database but this error occurs I do not know why. Can somebody help me? My SQL statement: Can somebody help me? Answer Firstly you need to tell MySQL which database you would like to use to create a table: If your database does not exist yet, you have to create one: then tell

SQL query Compare two WHERE clauses using same table

I am looking to compare two sets of data that are stored in the same table. I am sorry if this is a duplicate SO post, I have read some other posts but have not been able to implement it to solve my problem. I am running a query to show all Athletes and times for the most recent date

How to compare time in mysql

I have a column of Time data type in mysql. I want to compare the time with a time string but don’t know how to compare it. e.g., I want to know that some specific time is greater than 10:30:00. How …

Comparing TIMEDIFF in MySQL

I have these following data: and the following query that I want to use to find all the entries where the timediff is lesser than 50 hours The second row should be returned because it’s lesser than 50 hours, but the first row, which the timediff is more than 50 hours keep returning as well. It returns all sort of

insert if not exists in HQL

I am trying to write a query in HQL which can insert a record if it does not exists (with same name) so that there is no duplicate insertion when done from multiple threads. However, the record is not inserted. I suspect this is because the table is empty and the subquery returns 0 records despite the NOT EXISTS clause.

Advertisement