SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Selecting expert "new column"
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

leracj
Starting Member

Philippines
13 Posts

Posted - 06/29/2013 :  15:44:20  Show Profile  Reply with Quote
how about if i want to insert another row

basically i want to have a row for first name and another row for address
how do i do that?

my code:
SELECT DISTINCT ID, user_login, user_email, meta_value, COUNT( * ) , meta_key
FROM wp_users um, wp_usermeta u
WHERE (
user_login LIKE '%tho%'
OR meta_value LIKE '%tho%'
OR user_email LIKE '%tho%'
)
AND (
user_id = ID
AND (
meta_key = 'first_name'
OR meta_key = 'last_name'
OR meta_key = 'last_name'
OR meta_key = 'city'
OR meta_key = 'address'
OR meta_key = 'programs'
)
)
GROUP BY ID, user_login, user_email
HAVING COUNT( * ) >0
ORDER BY (

CASE meta_key
WHEN 'first_name'
THEN 1
ELSE 100
END
) ASC , meta_key ASC , meta_value
LIMIT 0 , 30

please help

please help

MuMu88
Aged Yak Warrior

547 Posts

Posted - 06/29/2013 :  19:01:58  Show Profile  Reply with Quote
Which version of SQL Server are you using?
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000