gpt4 book ai didi

mysql - 帮助完成此搜索查询

转载 作者:行者123 更新时间:2023-12-01 00:31:32 24 4
gpt4 key购买 nike

它在 phpmyadmin 第 1 行的 'SELECT c.candidate_id AS candidate_id,c.date_time_stamp AS candidate_date_time,c' 附近显示语法错误

SELECT * FROM states ORDER BY name ASC 

SELECT c.candidate_id AS candidate_id,
c.date_time_stamp AS candidate_date_time,
c.first_name AS first_name, c.last_name AS last_name,
c.availability_date AS availability_date,
c.experience_years AS experience_years,
c.phone AS phone,c.phone_alternate AS phone_alternate,
c.email AS email,c.bridge AS bridge,c.hot AS hot,
c.submitted AS submitted,c.placed AS placed,
sp.abbreviation AS specialty_abbreviation,
jt.name AS candidate_job_type,s.first_name AS staff_first_name
FROM candidates c
LEFT JOIN specialties sp ON sp.specialty_id=c.specialty_id
LEFT JOIN candidate_job_types jt ON jt.candidate_job_type_id=c.candidate_job_type_id
LEFT JOIN staff s ON s.staff_id=c.staff_id
WHERE c.active=1 AND
( CONCAT_WS(' ', c.first_name, c.last_name) LIKE '%gmail%' OR c.phone = 'gmail' OR
c.phone_alternate = 'gmail' OR c.email = 'gmail') GROUP BY c.candidate_id
ORDER BY c.date_time_stamp DESC LIMIT 0,100

最佳答案

由于合并了两个 SELECT 语句,您有错误。如果用 ; 分隔它们,它应该可以工作。

   SELECT * 
FROM states
ORDER BY name ASC;

SELECT c.candidate_id AS candidate_id,c.date_time_stamp AS candidate_date_time,
c.first_name AS first_name, c.last_name AS last_name,
c.availability_date AS availability_date,
c.experience_years AS experience_years,c.phone AS phone,
c.phone_alternate AS phone_alternate,c.email AS email,c.bridge AS bridge,
c.hot AS hot,c.submitted AS submitted,c.placed AS placed,
sp.abbreviation AS specialty_abbreviation,jt.name AS candidate_job_type,
s.first_name AS staff_first_name
FROM candidates c
LEFT JOIN specialties sp
ON sp.specialty_id=c.specialty_id
LEFT JOIN candidate_job_types jt
ON jt.candidate_job_type_id=c.candidate_job_type_id
LEFT JOIN staff s
ON s.staff_id=c.staff_id
WHERE c.active=1
AND ( CONCAT_WS(' ', c.first_name, c.last_name) LIKE '%gmail%'
OR c.phone = 'gmail'
OR c.phone_alternate = 'gmail'
OR c.email = 'gmail'
)
GROUP BY c.candidate_id
ORDER BY c.date_time_stamp DESC
LIMIT 0,100;

关于mysql - 帮助完成此搜索查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5184166/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com