有什么方法可以让名称显示在 mysql 的 select from 上而不是索引号上?
我正在为MySQL Workbench的大学项目制作数据库,因为我的老师要求这样做的一个请求,以便我可以从对Covid19测试的医疗咨询中选择患者,目前我的代码是这样。 :
从Consulta中选择Paciente,其中diagnostico ='covid19'
,
但这仅显示上述患者的索引号,我想要一个可以在其桌子上显示实际名称和姓氏的代码,有什么办法做吗?
编辑:对不起,我最初没有提供此信息,但是我试图触及的名称和姓氏在另一个名为“ Paciente”的表上
im making a database for a college project in mysql workbench, as one of the requisitions my teacher asked to make it so that i can select the patients from a medical consultation that did the test for Covid19, currently my code to do it is like this:
SELECT Paciente FROM consulta WHERE Diagnostico='Covid19'
however this only shows the index numbers of said patients, i wanted a code that could show up the actual names and surnames on their tables, is there any way to do it?
Edit: sorry i didnt give this info initially, but the name and surname im trying to reach are on another table called "paciente" of which this "Paciente" above is a foreign key of
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 Paciente 字段可能只包含 ID。您应该将其替换为 * 以显示每个字段,然后仅将 * 替换为您想要的字段。在这种情况下,姓名。
Your Paciente field probably only contains the ID. You should replace it to * to show every field and after that replace * with only the fields you want. In this case Name and Surname.