0

in MYSQL how to get specific columns name for example: i have following cols in databse

ID
NAME
ADDRESS
MOBILE

below query shows all the above columns name but i want to get all cols except ID and MOBILE.

SHOW COLUMNS FROM CONSIGNEE
4
  • Are you talking about select statement? use can use like this "select ID from tbname". Its pretty simple. Commented May 3, 2017 at 6:39
  • no i just want to get the columns name not data Commented May 3, 2017 at 6:40
  • Try : Select NAME,ADDRESS from CONSIGNEE Commented May 3, 2017 at 6:40
  • 1
    If you want to get list of columns for a given table you can query information_schema.columns table Commented May 3, 2017 at 6:40

1 Answer 1

1

Use WHERE to filter FIELD column

SHOW COLUMNS FROM CONSIGNEE WHERE FIELD NOT IN ('ID', 'MOBILE')
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.