how to get from table only one column and its downstair data?

from this:

show only this:


what will be mysql code of this?

Dani AI

Generated

Brief clarification and practical tips that build on the replies by , and :

You want the column values (the rows under one column), not the table schema. The SQL SELECT family returns row data; the SHOW family is for schema metadata. See the MySQL manual for details: SELECT statement and SHOW COLUMNS.

Common useful variants (examples):

SELECT DISTINCT column_name FROM table_name;

SELECT column_name
FROM table_name
WHERE column_name IS NOT NULL
ORDER BY column_name ASC
LIMIT 100;

Practical notes and troubleshooting:

  • To remove duplicates use DISTINCT or GROUP BY on that column.
  • Use WHERE to filter (non-null, active rows, etc.), ORDER BY to sort, and LIMIT to restrict count.
  • If a column name contains spaces, hyphens, or is a reserved word, wrap it in backticks, for example:
SELECT `order-id` FROM `orders`;
  • If a query returns an empty set, check: correct database/table, exact column spelling/casing (some filesystems make table names case-sensitive), and user privileges (SELECT permission).
  • From application code, select only the column you need and iterate over the result set for best performance.

These points expand on the earlier answers and cover the common edge cases people hit when they try to show “only one column” from a MySQL table.

Recommended Answers

All 4 Replies

Well, this isn't C++.

Also, I don't fully understand the question. You simply specify that Column before you perform the action. There's not much else to it.

SHOW column FROM table. this is yes am I right?

Yes, that's right.

No it's not. In SQL you'll need the SELECT statement:

SELECT yutis_raod FROM theTable;
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.