Hello Friends,
i am new to mysql and plz don't treat my question as a
cilly as i am just getting into mysql.
my problem is:
when i am executing the following query i am getting
the error. whats wrong with the query? "desc" of table
"accounting" and "user" and contents of them are also
listed below.
mysql version is :
mysql Ver 11.18 Distrib 3.23.54, for redhat-linux-gnu
(i386)
mysql> select *from accounting where uid = (select uid
from user wher gid="apswan");
ERROR 1064: You have an error in your SQL syntax near
'select uid from user wher gid="apswan")' at line 1
mysql>
mysql> desc user;
+-----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default |
Extra |
+-----------+-------------+------+-----+---------+-------+
| uid | varchar(20) | | PRI | |
|
| gid | varchar(20) | YES | | NULL |
|
| comment | text | YES | | NULL |
|
| password | varchar(35) | YES | | NULL |
|
| enable | varchar(35) | YES | | NULL |
|
| gpassword | varchar(35) | YES | | NULL |
|
| arap | varchar(35) | YES | | NULL |
|
| pap | varchar(35) | YES | | NULL |
|
| chap | varchar(35) | YES | | NULL |
|
| mschap | varchar(35) | YES | | NULL |
|
| expires | datetime | YES | | NULL |
|
| b_author | varchar(20) | YES | | NULL |
|
| a_author | varchar(20) | YES | | NULL |
|
| svc_dflt | int(4) | YES | | NULL |
|
| maxsess | int(4) | YES | | NULL |
|
| user | int(1) | YES | | NULL |
|
| acl_id | int(4) | YES | | NULL |
|
| sess | int(4) | YES | | NULL |
|
+-----------+-------------+------+-----+---------+-------+
18 rows in set (0.05 sec)
mysql> desc accounting;
+--------------+--------------+------+-----+---------------------+-------+
| Field | Type | Null | Key | Default
| Extra |
+--------------+--------------+------+-----+---------------------+-------+
| date | datetime | | MUL |
0000-00-00 00:00:00 | |
| nas | varchar(16) | | MUL |
| |
| uid | varchar(20) | | MUL |
| |
| terminal | varchar(20) | YES | | NULL
| |
| client_ip | varchar(16) | | MUL |
| |
| type | varchar(20) | YES | | NULL
| |
| service | varchar(20) | YES | | NULL
| |
| priv_lvl | int(2) | YES | | NULL
| |
| cmd | varchar(255) | YES | | NULL
| |
| elapsed_time | int(6) | YES | | NULL
| |
| bytes_in | int(10) | YES | | NULL
| |
| bytes_out | int(10) | YES | | NULL
| |
+--------------+--------------+------+-----+---------------------+-------+
12 rows in set (0.00 sec)
mysql>
mysql> select * from user;
+----------+--------+----------------+------------------------------------+--------+-----------+------+------+------+--------+---------------------+----------+----------+----------+---------+------+--------+------+
| uid | gid | comment | password
| enable | gpassword | arap | pap
| chap | mschap | expires | b_author |
a_author | svc_dflt | maxsess | user | acl_id | sess |
+----------+--------+----------------+------------------------------------+--------+-----------+------+------+------+--------+---------------------+----------+----------+----------+---------+------+--------+------+
| apswan | | network admins |
$1$.bJrxNDv$1JDyhV/kOwglyU7wVB1MH1 | | NULL
| | | | | 2003-10-26 18:36:44 |
| | 0 | 0 | 2 |
0 | NULL |
| manoj | apswan | DNC Chittoor |
$1$F6D75fPB$Mgu8OzHUZqzxzWsDSPoAT1 | | NULL
| | | | | 2003-10-25 18:43:22 |
| | 0 | 0 | 1 |
0 | NULL |
| dncchitt | apswan | DNC Chittoo |
$1$2pAHLzKV$qakvoD.PpZjWZh5u9TMiu. | | NULL
| | | | | 2003-10-25 19:00:46 |
welcome | bye bye | 0 | 0 | 1 |
0 | NULL |
| snc | apswan | SNC Engineer |
$1$rqG.1CUi$mkPT6tEMMtRrCcXbMH7Sp1 | | NULL
| | | | | 2003-10-25 19:01:28 |
| | 0 | 0 | 1 |
0 | NULL |
+----------+--------+----------------+------------------------------------+--------+-----------+------+------+------+--------+---------------------+----------+----------+----------+---------+------+--------+------+
4 rows in set (0.00 sec)
mysql> select * from accounting;
+---------------------+-----------+--------+----------+------------+-------+---------+----------+---------------------------------------------------------------+--------------+----------+-----------+
| date | nas | uid | terminal
| client_ip | type | service | priv_lvl | cmd
|
elapsed_time | bytes_in | bytes_out |
+---------------------+-----------+--------+----------+------------+-------+---------+----------+---------------------------------------------------------------+--------------+----------+-----------+
| 2003-10-19 18:52:55 | 10.37.5.2 | manoj | tty6
| 10.37.4.3/ | stop | shell | NULL | aaa
accounting network default start-stop group tacacs+
<cr> | NULL | NULL | NULL |
| 2003-10-19 18:53:18 | 10.37.5.2 | manoj | tty6
| 10.37.4.3/ | stop | shell | NULL | aaa
accounting resource default start-stop group tacacs+
<cr> | NULL | NULL | NULL |
| 2003-10-19 18:53:41 | 10.37.5.2 | manoj | tty6
| 10.37.4.3/ | stop | shell | NULL | aaa
accounting send stop-record authentication failure
<cr> | NULL | NULL | NULL |
| 2003-10-19 18:53:55 | 10.37.5.2 | manoj | tty6
| 10.37.4.3/ | stop | shell | NULL | aaa
accounting session-duration ntp-adjusted <cr>
| NULL | NULL | NULL |
| 2003-10-19 18:54:30 | 10.37.5.2 | manoj | tty6
| 10.37.4.3/ | stop | shell | NULL | aaa
accounting system default start-stop group tacacs+
<cr> | NULL | NULL | NULL |
| 2003-10-19 18:54:53 | 10.37.5.2 | manoj | tty6
| 10.37.4.3/ | stop | shell | NULL | aaa
accounting update newinfo <cr>
| NULL | NULL | NULL |
| 2003-10-19 18:55:23 | 10.37.5.2 | manoj | tty6
| 10.37.4.3/ | stop | shell | NULL | exit <cr>
|
NULL | NULL | NULL |
| 2003-10-19 18:55:28 | 10.37.5.2 | manoj | tty6
| 10.37.4.3/ | start | shell | NULL |
|
NULL | NULL | NULL |
| 2003-10-19 18:55:30 | 10.37.5.2 | manoj | tty6
| 10.37.4.3/ | stop | shell | NULL | enable
<cr>
| NULL | NULL | NULL |
| 2003-10-19 18:55:45 | 10.37.5.2 | manoj | tty6
| 10.37.4.3/ | stop | shell | NULL | show
running-config <cr>
| NULL | NULL | NULL |
| 2003-10-19 18:56:06 | 10.37.5.2 | manoj | tty6
| 10.37.4.3/ | stop | shell | NULL | clear ip
access-list counters <cr> |
NULL | NULL | NULL |
| 2003-10-19 18:56:15 | 10.37.5.2 | manoj | tty6
| 10.37.4.3/ | stop | shell | NULL | clear ip
access-list counters <cr> |
NULL | NULL | NULL |
| 2003-10-19 18:56:29 | 10.37.5.2 | manoj | tty6
| 10.37.4.3/ | stop | shell | NULL | clear ip
accounting <cr> |
NULL | NULL | NULL |
| 2003-10-19 18:56:31 | 10.37.5.2 | manoj | tty6
| 10.37.4.3/ | stop | shell | NULL | exit <cr>
|
NULL | NULL | NULL |
| 2003-10-19 18:56:31 | 10.37.5.2 | manoj | tty6
| 10.37.4.3/ | stop | shell | NULL |
|
62 | NULL | NULL |
| 2003-10-19 18:56:38 | 10.37.5.2 | apswan | tty0
| async/ | stop | shell | NULL | exit <cr>
|
NULL | NULL | NULL |
| 2003-10-19 18:56:40 | 10.37.5.2 | apswan | tty0
| async/ | stop | shell | NULL | exit <cr>
|
NULL | NULL | NULL |
| 2003-10-19 19:03:55 | 10.37.5.2 | manoj | tty0
| async/ | start | shell | NULL |
|
NULL | NULL | NULL |
| 2003-10-19 19:03:57 | 10.37.5.2 | manoj | tty0
| async/ | stop | shell | NULL | enable
<cr>
| NULL | NULL | NULL |
| 2003-10-19 19:04:01 | 10.37.5.2 | manoj | tty0
| async/ | stop | shell | NULL | show
running-config <cr>
| NULL | NULL | NULL |
| 2003-10-19 19:04:06 | 10.37.5.2 | manoj | tty0
| async/ | stop | shell | NULL | exit <cr>
|
NULL | NULL | NULL |
| 2003-10-19 19:04:06 | 10.37.5.2 | manoj | tty0
| async/ | stop | shell | NULL |
|
11 | NULL | NULL |
+---------------------+-----------+--------+----------+------------+-------+---------+----------+---------------------------------------------------------------+--------------+----------+-----------+
22 rows in set (0.00 sec)
mysql>
__________________________________
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
http://shopping.yahoo.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]