2017-02-27 15 views
-2

にSQLの相対で列を選択する方法:私は、このデータベース構造を持っている別の1

structure

フィールドidが主キーです。私はdepartment='civil' & level=4を持っているすべてのコースを見つけることを試みています。

+1

'SELECT * FROM yourTable WHERE department = 'civil' AND level = 4' –

+4

基礎を学ぶために良いSQLチュートリアルを見直すべきです。これはSQLについて学ぶ素晴らしい方法ではありません。 –

+0

大丈夫、ありがとうalot.Thats良い仕事 –

答えて

0

、これを試してみてください。しかし、私はそれがどのように動作するかについての短い説明をしましょう。あなたが明らかにオンラインで見えなかったからです。

SELECT course_name  -- This is the column that you will recieve. if you pick * instead of course_name it will select all columns which match the criteria. 
FROM table_name   -- you select the course_name from the table 'table_name' 
WHERE department='civil' -- This will select columns where the department column has 'civil' as a value 
AND level=4    -- This will also check if the level equals to 4. 

これは、回答が既に与えられているのであまり役に立ちません。しかし、私はそれがあなたにSQLを学ぶための有益な情報を与えることを願っています

+0

ありがとうございます。 –

0

は@kousikマーンダルの答えが正しいか

select course_name from table_name where department='civil' and level=4 
+1

ありがとう、それは別の方法で動作します。 –

関連する問題