由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Database版 - anyone can help on this query, thanks!
相关主题
请教一个有关SQL concat的问题sql question
誰來幫我開來開悄? Interesting SQL query请问这两个SQL QUERY有什么错?
请教一个求职面试题:如何写一个SQL query求表中对角线的和[转载] question about SQL in Access
请教2个sql query 问题[转载] Can anyone interpret this simple SQL?
怎样在T-SQl中执行一条放在varchar中的命令再请教大牛一个问题
如何用SQL语句判断一个TABLE是否存在?parameterized queries with no inputs
Help!!!! How to synchronized the data in SQL serverbetter solution for cross table query in sql?
一个SQL query的问题请教一个在stored procedure 里用bcp的问题.
相关话题的讨论汇总
话题: query话题: val话题: sql话题: anyone话题: null
进入Database版参与讨论
1 (共1页)
f**c
发帖数: 629
1
I am new to database. Could any one help on this easy query? Thanks alot.
Given the following SQL table:
create table myTable (
id int not null,
val varchar(2) not null
);
With values:
id val
-------
1 b
2 c
3 a
4 b
5 c
Write a single SQL query in MySQL 3.23 which will output the
following result, which is a list of records with equal 'val'
fields:
+-----+-----+-----+
w****t
发帖数: 33
2
self join

【在 f**c 的大作中提到】
: I am new to database. Could any one help on this easy query? Thanks alot.
: Given the following SQL table:
: create table myTable (
: id int not null,
: val varchar(2) not null
: );
: With values:
: id val
: -------
: 1 b

s***c
发帖数: 1926
3
self join 怎么把重复行去掉啊
1 4 b
4 1 b
2 5 c
5 2 c

【在 w****t 的大作中提到】
: self join
c*******e
发帖数: 8624
4
where a.id < b.id

【在 s***c 的大作中提到】
: self join 怎么把重复行去掉啊
: 1 4 b
: 4 1 b
: 2 5 c
: 5 2 c

s***c
发帖数: 1926
5
ft,我写了个 a.id<>b.id,然后对着屏幕发了10分钟的呆。

【在 c*******e 的大作中提到】
: where a.id < b.id
1 (共1页)
进入Database版参与讨论
相关主题
请教一个在stored procedure 里用bcp的问题.怎样在T-SQl中执行一条放在varchar中的命令
这个query怎么写?如何用SQL语句判断一个TABLE是否存在?
A SQL query never stop running is bothering me: help needed (转载)Help!!!! How to synchronized the data in SQL server
What does sum(2) mean?一个SQL query的问题
请教一个有关SQL concat的问题sql question
誰來幫我開來開悄? Interesting SQL query请问这两个SQL QUERY有什么错?
请教一个求职面试题:如何写一个SQL query求表中对角线的和[转载] question about SQL in Access
请教2个sql query 问题[转载] Can anyone interpret this simple SQL?
相关话题的讨论汇总
话题: query话题: val话题: sql话题: anyone话题: null