How to get a specific string, knowing the value of the primary key?

This is probably a very simple question for you, for example sql gurus, but I have never used sql before.

If the table "Person" has 3 rows: name (primary key), age and city, I know that I can get all the rows as follows:

SELECT * FROM Person;

But if the table looks like this:

Name   Age   City
-------------------
A       2     NY
B       4     BE
C       6     PA

What sql command do I need to use to get (for example) a second row? I know the name B.

+3
source share
5 answers
SELECT * FROM Person WHERE Name = 'B';

This solves this problem, but you can visit the w3schools sql tutorial to run.

+3
source
 SELECT * FROM Person
 WHERE Name = 'B';
+1
source

SELECT * FROM Person WHERE Name='B' , http://dev.mysql.com/doc/refman/5.0/en/select.html

+1

, . . ... ( , ). SSN "" , , , SSN Number;)

, , , , .

, ...

+1

, sql ( , , ), :

http://w3schools.com/sql

0

Source: https://habr.com/ru/post/1775804/


All Articles