Skip to content

How to do date math on SELECT columns?

The following query works perfectly: It returns two row each with two dates Instead of returning these two values in a table, I’d like each row to also have the difference of those two dates, in years or days. So I have two questions: What’s the general rule for combining columns? How do I subtrac…

Query to get all siblings

I have table like that: ID NAME SURNAME MotherID FatherID 0 JJ smi NULL NULL 1 ja rly NULL NUL 2 ak smi 0 1 3 ol smi 0 1 …

using alias to where clause query mysql

i have query but mysql showing this error: Unknown column ‘Aktifitas’ in ‘where clause’ why mysql Alias cant be use in Where clause, but is there something I missing? Thanks in advance. Answer You can’t use column’s alias in where clause you must repeat the code (because th…