字段列表中的列“大小"不明确 [英] Column 'size' in field list is ambiguous

查看:107
本文介绍了字段列表中的列“大小"不明确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无效的SQL:

SELECT
 info_hash,
 size,
 comment,
 created_by,
 announce_list,
 completed_by, 
 completed,
 seeders,
 leechers,
 ulspeed,
 dlspeed,
 dateline,
 thumbnail_dateline, 
 filename,
 filesize,
 visible,
 attachmentid,
 counter,
 postid, 
 IF(thumbnail_filesize > 0, 1, 0) AS hasthumbnail,
 thumbnail_filesize,
 attachmenttype.thumbnail AS build_thumbnail,
 attachmenttype.newwindow
FROM attachment
LEFT JOIN attachmenttype AS attachmenttype USING (extension)
WHERE postid IN (-1,2)
ORDER BY attachmentid;

MySQL错误:字段列表中的列大小"不明确 错误编号:1052

MySQL Error : Column 'size' in field list is ambiguous Error Number : 1052

推荐答案

这意味着size可能同时出现在attachmentattachmenttype中.

This means that size is presumably in both attachment and attachmenttype.

如果您限定列名,那么您将永远不会遇到这种类型的问题.

If you qualify your column names, then you won't ever have this type of problem.

这篇关于字段列表中的列“大小"不明确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆