Melakukan Update satu field dengan menggunakan value dari tabel lain pada Oracle sedikit lebih ribet daripada pada Mysql.
Pada Mysql biasanya dapat digunakan sql script sbb :
UPDATE [table_name_1] [alias_1],[table_name_2] [alias_2]
SET [alias_1].[column_name] = [alias_2].[column_name]
WHERE
[condition]
Tetapi pada Oracle hanya bisa dilakukan terhadap satu field saja dengan sql script sbb :
UPDATE [table_name] [alias]
SET ([column_name],[column_name] ) =
SELECT ([column_name], [column_name])
FROM [table_name]
WHERE [alias.column_name] = [alias.column_name]);
Tampilkan postingan dengan label Debugging. Tampilkan semua postingan
Tampilkan postingan dengan label Debugging. Tampilkan semua postingan
Kamis, 18 Desember 2008
Linux Copy Without Overwrite Confirmation
By default, Fedora Core seems to interpret every "cp" command I issue as
"cp
-i"--that is, it asks me if I'm sure whether or not I want to overwrite
umpteen files and I have to hit "y" and Enter a zillion times.
Any suggestions?
Thanks.
Chekc if you have an alias for 'cp'.
Type
$ alias
...
...
alias cp='cp -i'
...
...
And do
$ unalias cp
"cp
-i"--that is, it asks me if I'm sure whether or not I want to overwrite
umpteen files and I have to hit "y" and Enter a zillion times.
Any suggestions?
Thanks.
Chekc if you have an alias for 'cp'.
Type
$ alias
...
...
alias cp='cp -i'
...
...
And do
$ unalias cp
Oracle Not A Group By Expresion Error
Problem
When using a GROUP BY clause every field in the SELECT list must be either:- One of the GROUP BY terms - in this case region
- An aggregate function - for example SUM or COUNT
- An expression based on the above
In the example the field name may not be used on the SELECT line.
In a group by line each region shows up only once - however in a typical region such as Africa there are several different name values. WHich one should SQL pick?
Solutions
- Remove the offending field from the SELECT line
- Add the field to the GROUP BY clause
- Aggregate the offending field
Langganan:
Postingan (Atom)

