I have a select statement which will return 2 columns.
ID | IDParent
Then in my program I have to test if IDParent is < 1 then use
if IDParent is < 1 then use
You can use simply if statement under select query as like I have described below
if
select
if(some_condition,if_satisfied,not_satisfied)
SELECT IF(IDParent < 1,ID,IDParent) FROM yourTable ;