To retrieve all records not containing the name “sonia” and the phone number ‘9876543210’ from a MySQL table, and order the results by the phone_number
field, you can use the following SQL query:
sql
SELECT *
FROM your_table_name
WHERE name != 'sonia' AND phone_number != '9876543210'
ORDER BY phone_number;
Replace your_table_name
with the actual name of your table. This query selects all columns (*
) from the specified table where the name
is not ‘sonia’ and the phone_number
is not ‘9876543210’, and then orders the results by the phone_number
field.