mysql query 질문입니다....

lovethecorners의 이미지

죄송합니다. 일단 첨부한 파일을 한번 봐주세요.

어떻게 해서 jabber log 를 그림과 같이 mysql db 에 저장했습니다.
어떤식의 query를 사용해야 중복된것없이 보이게 할수있을지를 생각중입니다. 잘 않되네요....

도움주시면 감사하겠습니다.

File attachments: 
첨부파일 크기
Image icon redundancy.gif12.35 KB
gilsion의 이미지

group by Date 를 원하시는건 아니시겠죠? :oops:

lovethecorners의 이미지

gilsion wrote:
group by Date 를 원하시는건 아니시겠죠? :oops:

햐..좋은 방법입니다... :lol: 근데, 원하는건 그게 아닙니다.. :cry:

NamSa의 이미지

select distinct * from test;

이걸 말하시는 건가요?

lovethecorners의 이미지

NamSa wrote:
select distinct * from test;

이걸 말하시는 건가요?

그렇게 해도 변화는 없습니다. 제 경우는 일단

select id from `jive_log` group by memo 한후에

while(my $tmpid=$sth->fetchrow_array()) {

     select * from `jive_log` where jid='$tmpid'

}

이렇게 했습니다. 그러면 중복되는 부분은 없는데, 이게 시간별로 sort 가 않되더군요...

문젠, jabber log 파일이 같은것이 중복이 되어기록이 되어있습니다. 그것을 읽으면서 DB 에 저장을 하니 위의 문제가 생기는것입니다...

수정합니다...
해결 되었습니다...아, 진짜 바보 같았습니다....

NamSa의 이미지

DBbuster wrote:
NamSa wrote:
select distinct * from test;

이걸 말하시는 건가요?

그렇게 해도 변화는 없습니다. 제 경우는 일단

select id from `jive_log` group by memo 한후에

while(my $tmpid=$sth->fetchrow_array()) {

     select * from `jive_log` where jid='$tmpid'

}

이렇게 했습니다. 그러면 중복되는 부분은 없는데, 이게 시간별로 sort 가 않되더군요...

문젠, jabber log 파일이 같은것이 중복이 되어기록이 되어있습니다. 그것을 읽으면서 DB 에 저장을 하니 위의 문제가 생기는것입니다...

수정합니다...
해결 되었습니다...아, 진짜 바보 같았습니다....

어찌 해결하신 겁니까??

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.