If I want to select the max value of 1 record, but there are two columns that having the same max values?
How can I select both of them?

select * from table1
where myvalue = (select max(myvalue) from table1)

or something along those lines but I think you will get the idea. The system will perform the sub-query first to get the value you want then apply the result to your original query. Here is a sample I just ran on my system that worked.

SELECT * FROM Domain D where D.`Date_Created` = (SELECT max(`Date_Created`) FROM Domain )
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.