เริ่มต้นใช้งานเริ่มต้นใช้งานได้ฟรี

Looking for a string within a string

If you need to check whether an expression exists within a string, you can use the CHARINDEX() function. This function returns the position of the expression you are searching within the string.

The syntax is: CHARINDEX(expression_to_find, expression_to_search [, start_location])

In this exercise, you are going to use the voters table to search for information about the voters whose names meet several conditions.

แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร

Functions for Manipulating Data in SQL Server

ดูคอร์ส

แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ

ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์

SELECT 
	first_name,
	last_name,
	email 
FROM voters
-- Look for the "dan" expression in the first_name
WHERE ___ > 0;
แก้ไขและรันโค้ด