Hi All,
My question is related to SQL syntax, please help. Thank you very much.
Let say I have some records in the database like:
Some of name repeats few times (John = 3 times, Derrick = 2 times, Smith = 2 times). I want to select only their "representative" rows (records), i.e. I want to have all names but each can appear one time only (maybe their newest record). What I want to achieve is something like this:
What is the syntax/condition I should query with SELECT?
My question is related to SQL syntax, please help. Thank you very much.
Let say I have some records in the database like:
B4X:
_id name phone_number message card_number
==============================================================================
1 John 111111111 John is a teacher 123456678
2 Derrick 222222222 Derrick is a man 123456699
3 Smith 333333333 Smith is at home 123457799
1 John 111111111 John has left 123456678
2 Derrick 222222222 Derrick is drinking 123456699
1 John 111111111 Where is John? 123456678
7 Steve 444444444 Steve is here 123452211
4 Mary 555555555 Mary is singer 321135672
3 Smith 333333333 Smith is fine 123457799
B4X:
_id name phone_number message card_number
==============================================================================
1 John 111111111 John is a teacher 123456678
2 Derrick 222222222 Derrick is a man 123456699
3 Smith 333333333 Smith is at home 123457799
7 Steve 444444444 Steve is here 123452211
4 Mary 555555555 Mary is singer 321135672
What is the syntax/condition I should query with SELECT?
Last edited: