显示表中的所有列值

时间:2021-06-16 08:01:03

I want to show the all values from table. I know i can do that with

我想显示表中的所有值。我知道我可以做到这一点

SELECT COLUMN_NAMES FROM TABLE_NAME WHERE COLUMN='VALUE'

But it is showing just wanted values i want all columns with the SHOW COLUMN query.

但它显示的只是想要的值我想要所有列与SHOW COLUMN查询。

I have try it like this:

我试试这样:

SHOW COLUMNS FROM lang 

then it gives me all details from the lang table. So if i want to show lang table id = '5' like the following query

然后它给了我lang表中的所有细节。所以,如果我想显示lang table id ='5',就像下面的查询一样

SHOW COLUMNS FROM lang WHERE id='5'

then i am geting Unknown column 'id' in 'where clause'

然后我在'where子句'中查找未知列'id'

Please look at the following shema it is like my table.

请看下面的谢谢它就像我的桌子。

I want to show for example id=5 all information like id, key, english, turkish ect. Why i wanted this because if i add more then language like russian, germany ect. then i need to get also that language information in the result.

我想举例如id = 5所有信息,如id,key,english,turkish等。为什么我想要这个,因为如果我添加更多语言,如俄语,德国等。然后我需要在结果中获得该语言信息。

+------+----------------+---------------------+---------------------+
|  id  |      key       |     english         |   turkish           |
+------+----------------+---------------------+---------------------+
|  1   |       hi       |       Hi            |    Merhaba          |
+------+----------------+---------------------+---------------------+
|  2   |     profile    |      Profile        |    Profil           |
+------+----------------+---------------------+---------------------+ 
|  3   |      menu      |       Menu          |     Menü            |
+------+----------------+---------------------+---------------------+
|  4   |    forgot_pass |  Forgot Password    |  Şifremi Unuttum!   |
+------+----------------+---------------------+---------------------+
|  5   |    wellcome    |      Wellcome       |   Hoş geldiniz!     |
+------+----------------+---------------------+---------------------+

1 个解决方案

#1


-1  

Use SELECT * instead:

请改用SELECT *:

SELECT * FROM lang where id = '5'

#1


-1  

Use SELECT * instead:

请改用SELECT *:

SELECT * FROM lang where id = '5'