Skip to content

Tag: mysql

Combining 2 Tables in SQL and add a new column to a Table

I have 2 Tables. CustomerDetails table has columns ID, UUID, Name, Age. FavoriteCustomers table has columns ID, UUID CustomerDetails Table will have a lot of entries say 10000 rows. while FavoriteCustomers Table has very few entries. In CustomerDetails Table, ID and UUID form the combined unique ID. Now I wan…

Whats wrong with my query, should i use WHERE?

So, what am i doing wrong? This query: Will give me this error: Failed to run query: SQLSTATE[HY000]: General error: 1111 Invalid use of group function This query: Will give me this error: Failed to run query: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check …

SQL: Convert bigint type to formatted date

I believe this is a simple question, but I’ve been searched around and got no satisfactory answer. Basically I have a Bigint object in MYSQL, I want to convert it to date format like 20201004, for example: I’ve tried But neither allow formatting, I hope to get the easiest and fastest conversion. A…