Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Selecting expert "new column"

Author  Topic 

leracj
Starting Member

13 Posts

Posted - 2013-06-29 : 15:44:20
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

549 Posts

Posted - 2013-06-29 : 19:01:58
Which version of SQL Server are you using?
Go to Top of Page
   

- Advertisement -