sasha85
asked on
'as' blocks
i need to set a query with
left(uname,1)='a' or left(uname,1)='b' or left(uname,1)='c' AS abc
,left(uname,1)='d' or left(uname,1)='e' or left(uname,1)='f' AS def
some thing like this that i will be able to print as
response.write rs("abc")...
left(uname,1)='a' or left(uname,1)='b' or left(uname,1)='c' AS abc
,left(uname,1)='d' or left(uname,1)='e' or left(uname,1)='f' AS def
some thing like this that i will be able to print as
response.write rs("abc")...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
mysql="SELECT CASE WHEN left(uname,1) IN('ó','ó',ó') then uname else null end AS abc,CASE WHEN left(uname,1) IN('ó','ó',ó"') then uname else null end AS def FROM demo_users"
MySQL][ODBC 3.51 Driver][mysqld-4.1.21-comm unity-nt]Y ou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '×') then uname else null end AS abc,CASE WHEN left(uname,1) IN('×','×',×"') t' at line 1
MySQL][ODBC 3.51 Driver][mysqld-4.1.21-comm
ASKER
i mean
mysql="SELECT CASE WHEN left(uname,2) IN('ó','ó',ó') then uname else null end AS abc,CASE WHEN left(uname,2) IN('ó','ó',ó"') then uname else null end AS def FROM demo_users"
left(uname,2)
cause there are 2 chars...
but still this is query syntax...
mysql="SELECT CASE WHEN left(uname,2) IN('ó','ó',ó') then uname else null end AS abc,CASE WHEN left(uname,2) IN('ó','ó',ó"') then uname else null end AS def FROM demo_users"
left(uname,2)
cause there are 2 chars...
but still this is query syntax...
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I FOUND THE PROB...there was (') missing in the 3 part...
ASKER
ok than...how now i can print all the abc records first and then all the def?
ASKER
i mean in 2 groups...
ASKER
do i realy need to run on the all records 2 time ?
first to take out the abc and second time for the def?
or there is better way?
first to take out the abc and second time for the def?
or there is better way?
ASKER
if i will just
response.write "abc:" & xabc & "<br>"
response.write "def:" & xdef & "<br>"
it will print <br> instead of records wich got no abc or def...
response.write "abc:" & xabc & "<br>"
response.write "def:" & xdef & "<br>"
it will print <br> instead of records wich got no abc or def...
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
i got only one column...wich i want to divide into abc\def...
my plan is to print each rs("abc"),rs("def")...into diffrent div..
<div id=abc
<div id=def
...
my plan is to print each rs("abc"),rs("def")...into
<div id=abc
<div id=def
...
please explain more, what data you have as input in the column. just so we understand...
what is the div's about...
what is the div's about...
ASKER
sorry i dropped this idea
ASKER
mysql="?"