Skip to content
Advertisement

Seperate tables with same attributes in SQL

When using SQL database, when I have tables with same attributes. For example if I have [posts] with attributes (id, image, description, number of likes and dislikes) [Comments] with attributes (id, image, description, number of likes and dislikes) and [Replies] with attributes (id, image, description, number of likes and dislikes) and I have another type of posts, comments, replies for

How to group by multiple rows and column

For each user 3 codes are there(10,20,30) if all codes(10,20,30) are true then it has to JOINED if any codes(10,20,30) are False then it has to NEGLECTED WE have to check max(date) Table is below: Output user2 and user3 is JOINED, user1 is NEGLECTED Answer I assume that the column bool is of data type BOOL, so you can do

MySQL Spatial Join on Closest Point

I’ve looked around a bit and found quite a few people seeking to order a table of points by distance to a set point, but I’m curious how one would go about efficiently joining two tables on the …

how to get a list of all years from the mySQL

+————+—————+————+ | date | other_columns | date2 | +————+—————+————+ | 2019-05-23 | # | 2018-04-12 | +————+———–…

Advertisement